DEADSOFTWARE

monster tree cosmetix
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 20 Aug 2017 06:17:12 +0000 (09:17 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 20 Aug 2017 07:47:56 +0000 (10:47 +0300)
src/game/g_monsters.pas

index 9f395fdde5dc474ab1ef27649f64d3b6ea88eaef..1f1e71183c52b302e6b3f33927bc405c799506c8 100644 (file)
@@ -1932,7 +1932,7 @@ begin
     {$IF DEFINED(D2F_DEBUG)}
     e_WriteLog(Format('monster #%d(%u): removed from tree; nodeid=%d', [arrIdx, UID, treeNode]), MSG_NOTIFY);
     {$ENDIF}
-    monsTree.removeObject(treeNode);
+    if monsTree.isValidId(treeNode) then monsTree.removeObject(treeNode);
   end;
 
   if (arrIdx <> -1) then