projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Checkless and trackKingWrap()
[xogo.git]
/
base_rules.js
diff --git
a/base_rules.js
b/base_rules.js
index
0c316eb
..
e8cf4f4
100644
(file)
--- 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) {
// 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
let newKingPP = null,
sqIdx = 0,
res = true; //a priori valid