fixed minor issuer

This commit is contained in:
Didictateur 2025-03-30 11:37:06 +02:00
parent 70f1465f19
commit 88f6897008

View file

@ -139,7 +139,7 @@ export class Game {
} else { } else {
this.turn++; this.turn++;
} }
this.hasPicked = true; this.hasPicked = false;
this.hasPlayed = false; this.hasPlayed = false;
} else if (action === 1) { // chii } else if (action === 1) { // chii
let chiis = this.canDoAChii(); let chiis = this.canDoAChii();
@ -357,9 +357,10 @@ export class Game {
private canDoAPon(player: number = 0): boolean { private canDoAPon(player: number = 0): boolean {
if ( if (
this.lastDiscard !== undefined && this.lastDiscard !== undefined && // il y a une défausse
this.lastDiscard !== player && this.lastDiscard !== player && // pas sa propre défausse
this.turn !== player this.turn !== player && // pas son propre tour
!(this.hasPicked && !this.hasPlayed) // pas un joueur en train de jouer
) { ) {
let t = this.discards[this.lastDiscard][this.discards[this.lastDiscard].length-1]; let t = this.discards[this.lastDiscard][this.discards[this.lastDiscard].length-1];
return this.hands[player].count(t.getFamily(), t.getValue()) >= 2; return this.hands[player].count(t.getFamily(), t.getValue()) >= 2;