fix: prevent multiple P2 actions on same offer and improve UI consistency
- Add server validation to prevent P2 from taking multiple actions on the same offer - Hide P2 action buttons after an action is taken (using \!state.p2Action condition) - Add offer details display to G3, G4, and G5 (was missing) - Fix G2 to show offer details instead of just 'Oferta activa' - Reset game status to PLAYING when changing variant from FINISHED state - Ensure P2 can only make one decision per offer in all variants
This commit is contained in:
@@ -85,6 +85,10 @@ export class GameRoom extends Room<GameState> {
|
||||
const player = this.state.players.get(client.sessionId);
|
||||
if (!player) return;
|
||||
if (player.role !== "P2") return;
|
||||
|
||||
// Prevent multiple actions on the same offer
|
||||
if (this.state.p2Action) return;
|
||||
|
||||
this.state.p2Action = action; // accept | reject | snatch
|
||||
this.resolveP2Action();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user