index 4c354c30a1b3c60c086eaff684015df2d3bc0be0..05ec0b05e12524832d707d295b6ea4343a307e27 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
// 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;
var
gmon_debug_think: Boolean = true;
+ gmon_debug_one_think_step: Boolean = false;
implementation
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;
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
result := gMonsters[uid];
end;
+function g_Mons_TotalCount (): Integer; inline;
+begin
+ result := Length(gMonsters);
+end;
+
function g_Mons_ForEach (cb: TEachMonsterCB): Boolean;
var