diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 725ab6d701a05634adb9baffe2e256e6b94d41ee..3b1330170a988940f5d158494d4972a722faff6d 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
{$IF DEFINED(D2F_DEBUG)}
stt: UInt64;
{$ENDIF}
- pmark: PoolMark;
- hitcount: Integer;
- pmon: PMonster;
+ mit: PMonster;
+ it: TMonsterGrid.Iter;
begin
(*
if not gwep_debug_fast_trace then
// collect monsters
//g_Mons_AlongLine(x, y, x2, y2, sqchecker);
- pmark := framePool.mark();
- hitcount := monsGrid.forEachAlongLine(x, y, x2, y2, -1);
- pmon := PMonster(framePool.getPtr(pmark));
- while (hitcount > 0) do
- begin
- sqchecker(pmon^);
- Inc(pmon);
- Dec(hitcount);
- end;
- framePool.release(pmark);
+ it := monsGrid.forEachAlongLine(x, y, x2, y2, -1);
+ for mit in it do sqchecker(mit^);
+ it.release();
// here, we collected all monsters and players in `wgunHitHeap` and `wgunHitTime`
// also, if `wallWasHit` is `true`, then `wallHitX` and `wallHitY` contains spark coords