1
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
43e2a15197 v0.2.2 2026-09-06 17:46:45 -04:00
420bd1f411 fix(qualification): reset lane on restart and show whole-second countdown
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-06 17:46:44 -04:00
2 changed files with 6 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"name": "polaris-task-force",
"version": "0.2.1",
"version": "0.2.2",
"description": "Web app for the Arma 3 unit Polaris Task Force. Uses Next.js for client- and server-side rendering, with a Postgres database and some other neat libraries.",
"license": "MIT",
"type": "module",

View file

@ -325,9 +325,9 @@ export function AimTrainerGame({
}, [resetToReady, startGame]);
const handleRestartAction = useCallback(() => {
if (phaseRef.current !== "playing") return;
startGame();
}, [startGame]);
if (phaseRef.current === "ready") return;
resetToReady();
}, [resetToReady]);
const handleShot = useCallback(
(event: PointerEvent<HTMLCanvasElement>) => {
@ -458,10 +458,7 @@ export function AimTrainerGame({
if (remaining === 0) {
finish();
} else {
const displayedSecond =
remaining <= FINAL_COUNTDOWN_WINDOW_MS
? Math.ceil(remaining / 1000)
: COURSE_DURATION_SECONDS;
const displayedSecond = Math.ceil(remaining / 1000);
if (displayedSecond !== game.lastDisplayedSecond) {
game.lastDisplayedSecond = displayedSecond;
setTimerSeconds(displayedSecond);
@ -728,7 +725,7 @@ export function AimTrainerGame({
</div>
<div className="text-xs text-muted-foreground">
Headshots score {HEADSHOT_POINTS} · torso hits score {TORSO_POINTS} · civilians cost{" "}
{CIVILIAN_PENALTY}. Press R to restart the lane.
{CIVILIAN_PENALTY}. Press R to reset the lane.
</div>
</CardContent>
</Card>