From 2a3a62a0ab76a3f4ddd663441c74165a53447bd3 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sat, 26 Sep 2026 10:29:45 +0200 Subject: [PATCH] j127: fix TR_RACK_SHARE round-boundary dwell lock (bot.tick resets, tracker currentSince persists) - share path only --- common_libs/gun_harness/virtual_bullets.nim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common_libs/gun_harness/virtual_bullets.nim b/common_libs/gun_harness/virtual_bullets.nim index afbbb81..9e8c624 100644 --- a/common_libs/gun_harness/virtual_bullets.nim +++ b/common_libs/gun_harness/virtual_bullets.nim @@ -1202,8 +1202,13 @@ proc selectSharedGun*(t: var VirtualTracker, share: openArray[float], # Hold the incumbent through its dwell window (it is already one of the # admitted share guns). This is what keeps aim convergence; the deficit below - # is NOT advanced on a held tick. - if t.currentGun in guns and (tick - t.currentSince) < ActiveDwellTicks: + # is NOT advanced on a held tick. The `tick >= t.currentSince` guard is + # load-bearing: `bot.tick` RESETS to 0 each round while the tracker (and its + # `currentSince`) persists, so without it a negative elapsed would lock the + # round-1-end gun for every later round. The shipped ranking path keeps its + # own (single-gun-in-practice) dwell untouched. + if t.currentGun in guns and tick >= t.currentSince and + (tick - t.currentSince) < ActiveDwellTicks: return t.currentGun if t.shareDeficit.len != share.len: