fix(offline): hotseat finished-game medals by final score (fix all-last-place on a tie)
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m6s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m42s

Reported: a hotseat game ended by 6 scoreless passes deducts each rack
(correct rule, same as online: -8/-14/-8 here), which tied two seats for
the lead. The engine's winner() returns -1 on a tie, so seatMedal read it
as a full draw and gave EVERY seat the last-place medal.

- result.ts: seatMedal now ranks by the FINAL score (competition ranking —
  a tie for the lead shares the trophy), not the single-winner flag. A
  resigned / host-excluded seat places last with no medal and does not push
  the others down.
- model.ts: Seat.resigned (offline-only); engine.resignedOf getter; the
  local source surfaces it on the game view.
- The scoreless rack deduction is unchanged (standard rules, owner-confirmed).
This commit is contained in:
Ilia Denisov
2026-07-07 15:37:25 +02:00
parent 84d0385c95
commit 1e087be90a
6 changed files with 52 additions and 27 deletions
+1
View File
@@ -464,6 +464,7 @@ export class LocalSource implements GameLoopSource {
score: game.scoreOf(i),
hintsUsed: 0,
isWinner: game.isOver && i === game.winnerIndex,
resigned: game.resignedOf(i),
}));
return {
id: record.id,