From: Benjamin Auder Date: Sun, 17 Jan 2021 04:31:24 +0000 (+0100) Subject: Fix non-augmenting self absorptions X-Git-Url: https://git.auder.net/images/assets/doc/html/%7B%7B%20targetUrl%20%7D%7D?a=commitdiff_plain;h=34b79fe4fa5aecdfa64742e7ff98a1befffa34ed;p=vchess.git Fix non-augmenting self absorptions --- diff --git a/client/src/variants/Selfabsorption.js b/client/src/variants/Selfabsorption.js index edfa09f5..e7d3c071 100644 --- a/client/src/variants/Selfabsorption.js +++ b/client/src/variants/Selfabsorption.js @@ -10,7 +10,9 @@ export class SelfabsorptionRules extends AbsorptionRules { return ( p1 != p2 && [V.QUEEN, V.ROOK, V.KNIGHT, V.BISHOP].includes(p1) && - [V.QUEEN, V.ROOK, V.KNIGHT, V.BISHOP].includes(p2) + [V.QUEEN, V.ROOK, V.KNIGHT, V.BISHOP].includes(p2) && + (p1 != V.QUEEN || p2 == V.KNIGHT) && + (p2 != V.QUEEN || p1 == V.KNIGHT) ); }