You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"ERROR- RemoveCritter asked to remove a critter that dont exist."
This message appears every so often during play. The game still seems playable afterwards, but the map display is shifted slightly by it, which is ugly.
The text was updated successfully, but these errors were encountered:
This seems to happen when a Critter is killed on its action (possibly by walking into a trap). In CritterAction it checks if the Critter's HP < 0, at which point it calls CritterDeath (a second time) on that Critter. This second call to CritterDeath is what's causing the error. You can protect against this by checking SC^.CAct before calling CritterDeath the second time.
diff --git a/cbrain.pp b/cbrain.pp
index c1e9ad2..8cda48f 100644
--- a/cbrain.pp+++ b/cbrain.pp@@ -462,11 +462,14 @@ begin
end;
end;
+ {Protect against the case where the creature has already died}+ if SC^.CAct <> Nil then begin
{Update the critter's status.}
if NAttValue(C^.SF,NAG_StatusChange,SEF_Poison) <> 0 then begin
C^.HP := C^.HP - Random( 6 );
end;
UpdateStatusList( C^.SF );
+ end;
if C^.HP < 0 then CritterDeath(SC,C,False);
C := SC^.CAct;
"ERROR- RemoveCritter asked to remove a critter that dont exist."
This message appears every so often during play. The game still seems playable afterwards, but the map display is shifted slightly by it, which is ugly.
The text was updated successfully, but these errors were encountered: