1
0

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.
This commit is contained in:
Adrian Wannenmacher 2026-02-15 22:29:03 +01:00
parent b89206f113
commit bcb08a64d2
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5

View File

@ -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;