Fix promotions in Pandemonium1
[vchess.git] / client / src / variants / Pandemonium1.js
index aef9c06..0809219 100644 (file)
@@ -73,7 +73,8 @@ export class Pandemonium1Rules extends Pandemonium2Rules {
   }
 
   applyPromotions(moves, promoted) {
-    const lastRanks = (this.turn == 'w' ? [0, 1] : [V.size.x - 1, V.size.x]);
+    const lastRanks =
+      (this.turn == 'w' ? [0, 1] : [V.size.x - 1, V.size.x - 2]);
     let promotions = [];
     moves.forEach(m => {
       if (lastRanks.includes(m.start.x) || lastRanks.includes(m.end.x)) {