nerf promotion

This commit is contained in:
Didictateur 2025-12-02 21:27:47 +01:00
parent e42c3d04e9
commit 39912da311

View file

@ -1941,6 +1941,13 @@ io.on('connection', (socket) => {
targetPiece.type = toType;
targetPiece.promoted = true;
try{
if(board){
board.turn = (board.turn === 'w') ? 'b' : 'w';
try{ recordPlayerDrewPrev(room, senderId); }catch(_){ }
const nextColor = board.turn;
const nextPlayer = (room.players || []).find(p => (p.color && p.color[0]) === nextColor);
if(nextPlayer){ try{ maybeDrawAtTurnStart(room, nextPlayer.id); }catch(_){ } }
}
const effect = { id: played.id, type: 'promotion', pieceId: targetPiece.id, pieceSquare: target, playerId: senderId, ts: Date.now() };
room.activeCardEffects = room.activeCardEffects || [];
room.activeCardEffects.push(effect);