From 20a6132530ffab769ab351834acaeb87a2a39197 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Thu, 17 Sep 2026 08:01:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(SNNBot):=20add=20gun-settled=20guard=20befo?= =?UTF-8?q?re=20firing=20=E2=80=94=20only=20fire=20when=20gun=20turn=20rem?= =?UTF-8?q?aining=20<=201=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- SNNBot_garage/src/SNNBot.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SNNBot_garage/src/SNNBot.nim b/SNNBot_garage/src/SNNBot.nim index 8a494c6..1a72471 100644 --- a/SNNBot_garage/src/SNNBot.nim +++ b/SNNBot_garage/src/SNNBot.nim @@ -388,9 +388,9 @@ method run*(bot: SNNBot) = aimTo(bot.targetAngle, gunDir) let err = abs(normalizeRelativeAngle(bot.targetAngle - gunDir)) - # Fire gate: 5° always (P1 is fast, even imprecise shots can hit) + # Fire gate: gun must be aimed and settled before firing let energy = getEnergy() - let readyToFire = err < 5.0 and energy >= ENERGY_GUARD and bot.roundTick >= PATIENCE_TICKS + let readyToFire = err < 1.0 and abs(getGunTurnRemaining()) < 1.0 and energy >= ENERGY_GUARD and bot.roundTick >= PATIENCE_TICKS if readyToFire: bot.lastBulletSpeed = P2_SPEED discard setFire(2.0)