This commit is contained in:
AfonsoCMSousa
2026-01-03 13:14:59 +00:00
parent 0fb64ff30c
commit ceba5178f3
6 changed files with 316 additions and 279 deletions
+5 -2
View File
@@ -189,7 +189,9 @@ class BiscaGame {
this.players[winnerId].tricks += 1;
this.currentTurn = winnerId;
if (this.type == 3) {
// --- CRITICAL FIX: Always draw if cards remain ---
// Removed "if (this.type == 3)" check
if (this.deck.length > 0 || this.trumpCard) {
this.drawCard(winnerId);
this.drawCard(this.getOpponentId(winnerId));
}
@@ -221,7 +223,7 @@ class BiscaGame {
? p2Obj.id
: p1Obj.id;
return {
const result = {
action: "game_ended",
trickResult,
winnerId: finalWinner,
@@ -233,6 +235,7 @@ class BiscaGame {
player2_points: p2Obj.points,
totalTime: totalTime,
};
if (this.onGameEnd) {
this.onGameEnd(result);
}