From bcb08a64d2cdf68a3149ba31ce78023db099c0a9 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Sun, 15 Feb 2026 22:29:03 +0100 Subject: [PATCH] fix bug in tailor calculation The tailor calculation did not go down to one point if the losing team scored points only after the winning team reached the tailor goal. This has been fixed. This made me realize that I forgot to write tests for the `results` property of the game and session models. Those will follow in a later commit. --- models/game.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/game.js b/models/game.js index 4d113a8..2a6ce32 100644 --- a/models/game.js +++ b/models/game.js @@ -106,7 +106,11 @@ export default class Game extends EventTarget { let points; if (tailor !== null && winner !== tailor) { points = 4; - } else if (tailor !== null && winner === tailor) { + } else if ( + tailor !== null + && winner === tailor + && (ourPoints === 0 || theirPoints === 0) + ) { points = 2; } else { points = 1;