Skip to content

Commit b69faf3

Browse files
committed
fix: Npc_IsDead now checks BodyState instead of returning false
Was a FIXME stub hardcoded to return false, preventing any dead-NPC checks from working (e.g. Thorus couldn't recognize Mordrag as dead after being killed). Now checks Props.BodyState == BsDead, which FightService sets when HP reaches 0. Note: BodyState is runtime-only - a world reload will respawn the NPC alive. A permanent death flag in SaveGame state is needed as a follow-up fix.
1 parent a796600 commit b69faf3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Assets/Gothic-Core/Scripts/Services/Npc/NpcAiService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ public void ExtAiDrawWeapon(NpcInstance npc)
388388

389389
public bool ExtNpcIsDead(NpcInstance npcInstance)
390390
{
391-
// FIXME - We need to implement it properly. Just fixing NPEs for now!
392-
// FIXME - e.g. used for PC_Thief_AFTERTROLL_Condition() from Daedalus.
393-
return false;
391+
// FIXME - BodyState is runtime-only and lost on NPC reload (e.g. world reload respawns the NPC alive).
392+
// A permanent death flag needs to be persisted in SaveGame state and checked here instead.
393+
return npcInstance.GetUserData()?.Props.BodyState == VmGothicEnums.BodyState.BsDead;
394394
}
395395

396396
public bool ExtNpcIsInState(NpcInstance npc, int state)

0 commit comments

Comments
 (0)