feat(SNNBot): fire only when aim is locked on target

Bot now conserves ammo by firing only when aimLocked=true (error < 1.5°).
During WAITING phase, checks aimLocked flag before firing FIRE_POWER; calls
setFire(0.0) when not locked. Prevents wasted shots on moving targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 08:15:29 +02:00
parent c05fb7a32b
commit b843a79313
+4 -1
View File
@@ -385,7 +385,10 @@ method run*(bot: SNNBot) =
of WAITING:
aimTo(bot.targetAngle, gunDir)
discard setFire(FIRE_POWER)
if bot.aimLocked:
discard setFire(FIRE_POWER)
else:
discard setFire(0.0)
let err = abs(normalizeRelativeAngle(bot.targetAngle - gunDir))
if err < AIM_TOL:
bot.phase = EVALUATE