From 79c06e4b5bf3a75578cc81401fb7625073f4ae9b Mon Sep 17 00:00:00 2001 From: Safairette <71556532+Safairette@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:19:05 +0200 Subject: [PATCH 1/2] Exclude melee from wall frags --- Source/CombatExtended/Harmony/Harmony_DamageWorker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CombatExtended/Harmony/Harmony_DamageWorker.cs b/Source/CombatExtended/Harmony/Harmony_DamageWorker.cs index d0696f5254..78e426d75b 100644 --- a/Source/CombatExtended/Harmony/Harmony_DamageWorker.cs +++ b/Source/CombatExtended/Harmony/Harmony_DamageWorker.cs @@ -20,7 +20,7 @@ public static bool Prefix(DamageWorker __instance, DamageInfo dinfo, Thing victi { return true; } - if (victim.def.useHitPoints && dinfo.Def.harmsHealth && dinfo.Def != DamageDefOf.Mining) + if (victim.def.useHitPoints && dinfo.Def.harmsHealth && dinfo.tool == null && dinfo.Def != DamageDefOf.Mining) { if (victim.def.category == ThingCategory.Building) { From ed3b5904038dda014bd682b4e6e0146478a772da Mon Sep 17 00:00:00 2001 From: Safairette <71556532+Safairette@users.noreply.github.com> Date: Sat, 30 Nov 2024 11:55:33 +0200 Subject: [PATCH 2/2] Add tools to melee dinfo --- Source/CombatExtended/CombatExtended/Verbs/Verb_MeleeAttackCE.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/CombatExtended/CombatExtended/Verbs/Verb_MeleeAttackCE.cs b/Source/CombatExtended/CombatExtended/Verbs/Verb_MeleeAttackCE.cs index 507be08f03..aed08e3afa 100644 --- a/Source/CombatExtended/CombatExtended/Verbs/Verb_MeleeAttackCE.cs +++ b/Source/CombatExtended/CombatExtended/Verbs/Verb_MeleeAttackCE.cs @@ -471,6 +471,7 @@ protected virtual IEnumerable DamageInfosToApply(LocalTargetInfo tar damageInfo.SetWeaponBodyPartGroup(bodyPartGroupDef); damageInfo.SetWeaponHediff(hediffDef); damageInfo.SetAngle(direction); + damageInfo.SetTool(tool); yield return damageInfo; if (this.tool != null && this.tool.extraMeleeDamages != null) {