fix(SNNBot): add gun-settled guard before firing — only fire when gun turn remaining < 1°
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user