X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_weapons.pas;h=78965efd9378623329c16f2778abfd4daa412098;hb=6560a7fbc09aaefc7dea42de78d4336bbb42b532;hp=725ab6d701a05634adb9baffe2e256e6b94d41ee;hpb=ad4f5ec68b851b9b2dba627e3b199b93f529dc86;p=d2df-sdl.git diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 725ab6d..78965ef 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -1467,9 +1467,8 @@ var {$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 @@ -1526,16 +1525,9 @@ begin // 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 @@ -2159,7 +2151,7 @@ begin if Stopped = 0 then begin - st := g_Obj_Move(@Obj, False, spl); + st := g_Obj_Move_Projectile(@Obj, False, spl); end else begin