j134 fix: tracker must take the mover's switch per-call (instance flag was silently off on the object-literal construction path) + apply the correction on the reading that carries the server's turn-N+1 energy change (two-slot buffer); live-verified alignment
This commit is contained in:
@@ -263,7 +263,7 @@ type
|
||||
lastPickCall: int ## callCount at the last pick (log only)
|
||||
picks: int ## number of picks this round (log only)
|
||||
|
||||
proc initTFIL*(): TFILModule = TFILModule(debugGraphics: false, fire: initFireTracker(TfilFireFix))
|
||||
proc initTFIL*(): TFILModule = TFILModule(debugGraphics: false, fire: initFireTracker())
|
||||
|
||||
proc removeBulletNear*(m: var TFILModule, x, y: float) =
|
||||
## Mark the tracked bullet closest to (x,y) within GridSize tolerance as dead.
|
||||
@@ -371,17 +371,19 @@ proc spawnTrackedWave(m: var TFILModule, ws: WorldState, ei: EnemyInfo,
|
||||
|
||||
proc noteEnemyBulletHit*(m: var TFILModule, power: float) =
|
||||
## `onHitByBullet` -> the shooter's `3*power` bonus (no-op when off).
|
||||
m.fire.noteEnemyBulletHit(power)
|
||||
if TfilFireFix:
|
||||
m.fire.noteEnemyBulletHit(power)
|
||||
|
||||
proc noteDamageDealt*(m: var TFILModule, damage: float) =
|
||||
## `onBulletHit` -> our same-tick damage to the enemy (no-op when off).
|
||||
m.fire.noteDamageDealt(damage)
|
||||
if TfilFireFix:
|
||||
m.fire.noteDamageDealt(damage)
|
||||
|
||||
proc detectFires(m: var TFILModule, ws: WorldState) =
|
||||
## Check all enemies for energy drops; spawn a tracked bullet per confirmed
|
||||
## fire. The shared tracker corrects the delta and splits over-cap drops.
|
||||
for ei in ws.enemies:
|
||||
for p in m.fire.detect(ei.id, ei.energy, 0.09, 3.01):
|
||||
for p in m.fire.detect(ei.id, ei.energy, 0.09, 3.01, TfilFireFix):
|
||||
m.spawnTrackedWave(ws, ei, p)
|
||||
m.fire.endScan()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user