From: Ketmar Dark Date: Sun, 20 Aug 2017 06:20:15 +0000 (+0300) Subject: more monster tree cosmetix X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=2281a9384c7d29ae85f32a746fa748e000a7870f;p=d2df-sdl.git more monster tree cosmetix --- diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 1f1e711..f5f69a9 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -1134,8 +1134,8 @@ procedure g_Monsters_Free(); var a: Integer; begin - for a := 0 to High(gMonsters) do gMonsters[a].Free(); monsTree.reset(); + for a := 0 to High(gMonsters) do gMonsters[a].Free(); gMonsters := nil; clearUidMap(); monCheckTrapLastFrameId := 0; @@ -1929,10 +1929,13 @@ begin if (treeNode <> -1) then begin - {$IF DEFINED(D2F_DEBUG)} - e_WriteLog(Format('monster #%d(%u): removed from tree; nodeid=%d', [arrIdx, UID, treeNode]), MSG_NOTIFY); - {$ENDIF} - if monsTree.isValidId(treeNode) then monsTree.removeObject(treeNode); + if monsTree.isValidId(treeNode) then + 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); + end; end; if (arrIdx <> -1) then