Split The code is public; the app answers only to the crew.
A bot reloads only when its magazine is empty, so it reloads in the middle of the fight it just started #231
Check · Review · Land · Live done — Landed and live in production.
Pushed.
shipped merged
Sign in to join this conversation.
Pushed.
Bots now reload on their own schedule instead of discovering an empty magazine in the middle of a duel.
topUp(bots.ts): the moment a bot'spickTargetfinds no enemy to see, a magazine at half capacity or less requests a reload — same branch the fight itself already gates on, so this can never start a reload with someone watching.outOfAmmoreplaces the two oldmag === 0checks: a bot that runs its current weapon dry mid-fight now draws its loaded sidearm (switchTo) instead of reloading, falling back to reload only once the sidearm itself is empty too.bots.test.tscover the four cases from the issue; two fail againstmain(verified), all pass with the fix.Measured headless over 30 seeded
SHORTmatches (seed 41), before/after: plant rate 67% → 81%, rounds ending in elimination 26% → 12% — bots dying while standing still reloading was costing rounds outright.scripts/duel.ts(the 6-second arena duel) is essentially unchanged (71%/38% vs README's 73%/39%, within the arena's usual run-to-run noise), as expected since a fresh 30-round rifle rarely runs dry in a 6-second episode.Left out: no change to
observe.tsor the policy's inputs, per the issue's constraint — a bot's own magazine is already implicit in its behaviour, not something the learned policy reasons about.Closes #187