hotfix: Finnal fix
This commit is contained in:
@@ -48,8 +48,11 @@ class BiscaGame {
|
||||
|
||||
this.dealInitialCards();
|
||||
|
||||
const playerIds = Object.keys(this.players);
|
||||
this.currentTurn = playerIds.find((id) => id != 1) || playerIds[0];
|
||||
// --- FIX: Ensure currentTurn uses the original ID type (Number) ---
|
||||
// Object.keys returns strings ("1"), which breaks strict checks against user.id (1)
|
||||
const playerKeys = Object.keys(this.players);
|
||||
const startKey = playerKeys.find((key) => key != 1) || playerKeys[0];
|
||||
this.currentTurn = this.players[startKey].id;
|
||||
|
||||
this.startTime = Date.now();
|
||||
this.status = "playing";
|
||||
@@ -189,8 +192,7 @@ class BiscaGame {
|
||||
this.players[winnerId].tricks += 1;
|
||||
this.currentTurn = winnerId;
|
||||
|
||||
// --- CRITICAL FIX: Always draw if cards remain ---
|
||||
// Removed "if (this.type == 3)" check
|
||||
// --- FIX: Always draw if deck has cards (Removed type check) ---
|
||||
if (this.deck.length > 0 || this.trumpCard) {
|
||||
this.drawCard(winnerId);
|
||||
this.drawCard(this.getOpponentId(winnerId));
|
||||
|
||||
Reference in New Issue
Block a user