scroll.server/crates/game-service/tests
WiseDev 7f78fd5104 count the deploy timer down and hold the troop still while it runs
audit findings #8/#11. the encoded deploy field (LogicCharacter field47)
is the REMAINING deploy time: the client seeds it with DeployTime in
setState(5) and LogicCharacter::tick counts it down by 50 each tick,
returning early from the whole tick - no move, no retarget, no attack -
until it reaches 0, then setDefaultState flips the unit to moving(1) or
idle(0). our advance_deploy counted the opposite way (elapsed, 0 up to
DeployTime), so the encoded timer was DeployTime-minus-the-client's every
tick of every deploy, and the troop also moved and fought a full second
early.

now: a summoned troop spawns in state 5 with deploy_timer = DeployTime,
the timer decrements to 0, is_deploying() gates retarget/move/attack
while it is positive, and the state flips to moving/idle when it lands.
towers have DeployTime 0 and are unaffected.

harness: one tick in, the timer has dropped by 50 and the troop has not
moved; after the window it is at 0 and moving.
2026-08-24 09:39:13 +03:00
..
achievements_and_levels.rs grant achievement progress and roll exp into levels 2026-08-24 09:15:22 +03:00
walk_to_tower.rs count the deploy timer down and hold the troop still while it runs 2026-08-24 09:39:13 +03:00