From b843a79313efa807869564898d56779b9efb7332 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Tue, 15 Sep 2026 08:15:29 +0200 Subject: [PATCH] feat(SNNBot): fire only when aim is locked on target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- SNNBot_garage/src/SNNBot.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SNNBot_garage/src/SNNBot.nim b/SNNBot_garage/src/SNNBot.nim index 8f7b699..b0d2202 100644 --- a/SNNBot_garage/src/SNNBot.nim +++ b/SNNBot_garage/src/SNNBot.nim @@ -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