DEADSOFTWARE

fixed bug in grid update; one more mode for Holmes
[d2df-sdl.git] / src / game / g_monsters.pas
index 4c354c30a1b3c60c086eaff684015df2d3bc0be0..05ec0b05e12524832d707d295b6ea4343a307e27 100644 (file)
@@ -200,6 +200,8 @@ function g_Mons_ByIdx (uid: Integer): TMonster; inline;
 // can return null
 function g_Mons_ByIdx_NC (uid: Integer): TMonster; inline;
 
+function g_Mons_TotalCount (): Integer; inline;
+
 function g_Mons_IsAnyAliveAt (x, y: Integer; width, height: Integer): Boolean;
 
 function g_Mons_ForEach (cb: TEachMonsterCB): Boolean;
@@ -241,6 +243,7 @@ var
 
 var
   gmon_debug_think: Boolean = true;
+  gmon_debug_one_think_step: Boolean = false;
 
 
 implementation
@@ -1290,8 +1293,9 @@ begin
 
   gMon := True; // Äëÿ ðàáîòû BlockMon'à
 
-  if (gmon_debug_think) then
+  if gmon_debug_think or gmon_debug_one_think_step then
   begin
+    gmon_debug_one_think_step := false;
     for a := 0 to High(gMonsters) do
     begin
       if (gMonsters[a] = nil) then continue;
@@ -4487,7 +4491,6 @@ begin
   if (result = nil) then raise Exception.Create('g_Mons_ByIdx: invalid monster id');
 end;
 
-
 // can return null
 function g_Mons_ByIdx_NC (uid: Integer): TMonster; inline;
 begin
@@ -4495,6 +4498,11 @@ begin
   result := gMonsters[uid];
 end;
 
+function g_Mons_TotalCount (): Integer; inline;
+begin
+  result := Length(gMonsters);
+end;
+
 
 function g_Mons_ForEach (cb: TEachMonsterCB): Boolean;
 var