X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=base_rules.js;h=e8cf4f4a0032613f4ba5afafe24392e4efbfa34d;hb=f57232cdb4ea7c7b5fab1c7ef23c26714d26501e;hp=0c316ebddadbe3516c19601b70e47ac450bcb687;hpb=de1421be3ee53cb4ea8f112834d3de7a863fdd40;p=xogo.git diff --git a/base_rules.js b/base_rules.js index 0c316eb..e8cf4f4 100644 --- a/base_rules.js +++ b/base_rules.js @@ -2171,6 +2171,10 @@ export default class ChessRules { // cb: callback returning a boolean (false if king missing) trackKingWrap(move, kingPos, cb) { + if (move.appear.length == 0 && move.vanish.length == 0) + return true; + const color = + (move.vanish.length > 0 ? move.vanish[0].c : move.appear[0].c); let newKingPP = null, sqIdx = 0, res = true; //a priori valid