Fix Spartan Chess: warlord attacks now detected
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 16 Mar 2021 09:25:36 +0000 (10:25 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 16 Mar 2021 09:25:36 +0000 (10:25 +0100)
client/src/variants/Spartan.js

index acab8ad..2400e04 100644 (file)
@@ -274,9 +274,9 @@ export class SpartanRules extends ChessRules {
 
   isAttackedByWarlord(sq) {
     return (
-      super.isAttackedBySlideNJump(sq, 'b', V.GENERAL,
-        V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep") ||
-      super.isAttackedBySlideNJump(sq, 'b', V.GENERAL, V.steps[V.ROOK])
+      super.isAttackedBySlideNJump(
+        sq, 'b', V.WARLORD, V.steps[V.KNIGHT], "oneStep") ||
+      super.isAttackedBySlideNJump(sq, 'b', V.WARLORD, V.steps[V.BISHOP])
     );
   }