index 55a02104f4a56e602de638d507b13490936100cf..d577b235b946c5d6ff143ba4c7930c34af7446e0 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
type
- TEachMonsterCB = function (monidx: Integer; mon: TMonster): Boolean is nested; // return `true` to stop
+ TEachMonsterCB = function (mon: TMonster): Boolean is nested; // return `true` to stop
// throws on invalid uid
function g_Mons_ByIdx (uid: Integer): TMonster; inline;
Result := False;
end;
+
function BehaviourDamage(SpawnerUID: Word; BH, SelfType: Byte): Boolean;
var
m: TMonster;
end;
end;
+
function canShoot(m: Byte): Boolean;
begin
Result := False;
end;
end;
-function isCorpse(o: PObj; immediately: Boolean): Integer;
+
+function isCorpse (o: PObj; immediately: Boolean): Integer;
function monsCollCheck (mon: TMonster; atag: Integer): Boolean;
begin
mon := gMonsters[idx];
if (mon <> nil) then
begin
- result := cb(idx, gMonsters[idx]);
+ result := cb(mon);
if result then exit;
end;
end;
mon := gMonsters[idx];
if (mon <> nil) and mon.Live then
begin
- result := cb(idx, gMonsters[idx]);
+ result := cb(mon);
if result then exit;
end;
end;
@@ -4513,7 +4516,7 @@ function g_Mons_ForEachAt (x, y: Integer; width, height: Integer; cb: TEachMonst
function monsCollCheck (mon: TMonster; atag: Integer): Boolean;
begin
result := false;
- if g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon.arrIdx, mon);
+ if g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon);
end;
var
begin
if g_Obj_Collide(x, y, width, height, @mon.Obj) then
begin
- result := cb(idx, mon);
+ result := cb(mon);
if result then exit;
end;
end;
@@ -4549,7 +4552,7 @@ function g_Mons_ForEachAliveAt (x, y: Integer; width, height: Integer; cb: TEach
function monsCollCheck (mon: TMonster; atag: Integer): Boolean;
begin
result := false;
- if mon.Live and g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon.arrIdx, mon);
+ if mon.Live and g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon);
end;
var
begin
if g_Obj_Collide(x, y, width, height, @mon.Obj) then
begin
- result := cb(idx, mon);
+ result := cb(mon);
if result then exit;
end;
end;