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:
2026-09-26 12:56:26 +02:00
parent 6ad5d99922
commit 882733819b
8 changed files with 133 additions and 79 deletions
+6 -4
View File
@@ -474,7 +474,7 @@ type
lastTileCol, lastTileRow: int
proc initStrafe*(): StrafeModule =
StrafeModule(debugGraphics: false, fire: initFireTracker(StrafeFireFix))
StrafeModule(debugGraphics: false, fire: initFireTracker())
proc removeBulletNear*(m: var StrafeModule, x, y: float) =
## Mark the tracked bullet closest to (x,y) within GridSize tolerance as dead.
@@ -592,7 +592,8 @@ proc noteEnemyBulletHit*(m: var StrafeModule, power: float) =
## "no fire"). ModularBot forwards `onHitByBullet`'s `e.bullet.power` here so
## `detectFires` can add the bonus back before classifying the delta.
## No-op when the fix is off (shipped detector preserved).
m.fire.noteEnemyBulletHit(power)
if StrafeFireFix:
m.fire.noteEnemyBulletHit(power)
proc noteDamageDealt*(m: var StrafeModule, damage: float) =
## The mirror contamination: OUR bullet damaging the enemy this tick adds
@@ -600,7 +601,8 @@ proc noteDamageDealt*(m: var StrafeModule, damage: float) =
## cap and get the enemy's OWN shot rejected by the shipped `<= 3.01` test.
## ModularBot forwards `onBulletHit`'s `e.damage` here.
## No-op when the fix is off.
m.fire.noteDamageDealt(damage)
if StrafeFireFix:
m.fire.noteDamageDealt(damage)
proc detectFires(m: var StrafeModule, ws: WorldState) =
## The shared tracker does the delta correction + split; STRAFE supplies its
@@ -612,7 +614,7 @@ proc detectFires(m: var StrafeModule, ws: WorldState) =
" raw=", raw,
" bonus=", m.fire.hitBonusPending,
" dealt=", m.fire.dealtPending
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, StrafeFireFix):
m.spawnTrackedWave(ws, ei, p)
m.fire.endScan()