From: Benjamin Auder Date: Thu, 21 May 2020 09:06:17 +0000 (+0200) Subject: Fix Koopa promotions after stunning pieces X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/images/scripts/doc/current/git-favicon.png?a=commitdiff_plain;h=78a75d54a18dec6dcedeeba98e5f67645d2edd51;p=vchess.git Fix Koopa promotions after stunning pieces --- diff --git a/client/src/variants/Koopa.js b/client/src/variants/Koopa.js index 3f2e855a..c7b0859f 100644 --- a/client/src/variants/Koopa.js +++ b/client/src/variants/Koopa.js @@ -184,7 +184,10 @@ export class KoopaRules extends ChessRules { m.appear[0].x = i; m.appear[0].y = j; // Is it a pawn on last rank? - if ((color == 'w' && i == 0) || (color == 'b' && i == 7)) { + if ( + m.appear[0].p == V.PAWN && + ((color == 'w' && i == 0) || (color == 'b' && i == 7)) + ) { m.appear[0].p = V.ROOK; for (let ppiece of [V.KNIGHT, V.BISHOP, V.QUEEN]) { let mp = JSON.parse(JSON.stringify(m));