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
+2 -3
View File
@@ -613,8 +613,7 @@ method onBulletHit*(bot: ModularBot, e: BulletHitBotEvent) =
bot.surfMover.noteDamageDealt(e.damage)
bot.learnedMover.noteDamageDealt(e.damage)
if FireDiag:
echo "[firediag] EV dmg tick=", bot.tick, " damage=", e.damage
# Capture the rack BEFORE resolveOwnBullet drops the bullet's mode slot.
echo "[firediag] EV dmg tick=", bot.tick, " getTurn=", getTurn(), " damage=", e.damage # Capture the rack BEFORE resolveOwnBullet drops the bullet's mode slot.
let hitMode = bot.bulletMode.getOrDefault(e.bullet.bulletId, vb.rm1v1)
# onBulletHit only fires for our own bullets (victimId != myId); see json_parse.nim.
let gunId = bot.resolveOwnBullet(e.bullet.bulletId)
@@ -673,7 +672,7 @@ method onHitByBullet*(bot: ModularBot, e: HitByBulletEvent) =
bot.surfMover.noteEnemyBulletHit(e.bullet.power)
bot.learnedMover.noteEnemyBulletHit(e.bullet.power)
if FireDiag:
echo "[firediag] EV hit tick=", bot.tick, " power=", e.bullet.power
echo "[firediag] EV hit tick=", bot.tick, " getTurn=", getTurn(), " power=", e.bullet.power
# Feeds the ram bullet-rain abort window. Accumulate REAL ENERGY (the server's
# 4p/6p-2 damage), not raw firepower, so `damageRatePerTurn` is a real
# energy/turn rate (see movements/ram_decision.bulletDamage).