From c4853eb5761bdef67ecd69cda08aa0c96ac173a8 Mon Sep 17 00:00:00 2001 From: Manifold Paradox Date: Sun, 28 Apr 2024 13:10:05 +0900 Subject: [PATCH] Fix NRE when selecting Corpse --- .../CombatExtended/Comps/CompMeleeTargettingGizmo.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/CombatExtended/CombatExtended/Comps/CompMeleeTargettingGizmo.cs b/Source/CombatExtended/CombatExtended/Comps/CompMeleeTargettingGizmo.cs index d2aee69fe1..886705d698 100644 --- a/Source/CombatExtended/CombatExtended/Comps/CompMeleeTargettingGizmo.cs +++ b/Source/CombatExtended/CombatExtended/Comps/CompMeleeTargettingGizmo.cs @@ -171,7 +171,8 @@ private string heightString public override IEnumerable CompGetGizmosExtra() { // Don't let people control melee targeting for non-colonist pawns or colonists in a mental state - if (!PawnParent.IsColonist || PawnParent.InAggroMentalState) + // Corpses are also auto-assigned this comp, but clearly they are not typeof(Pawn) + if (parent is Corpse || !PawnParent.IsColonist || PawnParent.InAggroMentalState) { yield break; }