diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 2cdfe87a09935a9dac8cebba83412243a47ed6cf..f8028eef33fc30d94871d95b80759ae45421593c 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
function GunHit(X, Y: Integer; vx, vy: Integer; dmg: Integer;
SpawnerUID: Word; AllowPush: Boolean): Byte;
- function monsCheck (monidx: Integer; mon: TMonster): Boolean;
+ {function monsCheck (monidx: Integer; mon: TMonster): Boolean;
begin
result := false; // don't stop
- if (mon <> nil) and mon.Live and mon.Collide(X, Y) then
+ if mon.Live and mon.Collide(X, Y) then
begin
if HitMonster(mon, dmg, vx*10, vy*10-3, SpawnerUID, HIT_SOME) then
begin
result := true;
end;
end;
+ end;}
+
+ function monsCheck (monidx: Integer; mon: TMonster): Boolean;
+ begin
+ result := false; // don't stop
+ if HitMonster(mon, dmg, vx*10, vy*10-3, SpawnerUID, HIT_SOME) then
+ begin
+ if AllowPush then mon.Push(vx, vy);
+ result := true;
+ end;
end;
var
if Result <> 0 then Exit;
- if g_Mons_ForEach(monsCheck) then result := 2;
+ //if g_Mons_ForEach(monsCheck) then result := 2;
+ if g_Mons_ForEachAtAlive(X, Y, 1, 1, monsCheck) then result := 2;
end;
procedure g_Weapon_BFG9000(X, Y: Integer; SpawnerUID: Word);