X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_weapons.pas;h=f8028eef33fc30d94871d95b80759ae45421593c;hb=829537fc7b2b29baaab7287e54fba2cdd8d00b5c;hp=2cdfe87a09935a9dac8cebba83412243a47ed6cf;hpb=9a9d791ef253787be317876f7da973e2e1f6e2c5;p=d2df-sdl.git diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 2cdfe87..f8028ee 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -392,10 +392,10 @@ end; 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 @@ -403,6 +403,16 @@ function GunHit(X, Y: Integer; vx, vy: Integer; dmg: Integer; 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 @@ -423,7 +433,8 @@ begin 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);