projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
After refactoring. Seems more or less ok
[xogo.git]
/
base_rules.js
diff --git
a/base_rules.js
b/base_rules.js
index
5b1a013
..
b315fd5
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2080,7
+2080,7
@@
export default class ChessRules {
// will be executed in filterValid() later.
(
i != finalSquares[castleSide][0] &&
// will be executed in filterValid() later.
(
i != finalSquares[castleSide][0] &&
- this.underCheck([
x, i
], oppCol)
+ this.underCheck([
[x, i]
], oppCol)
)
||
(
)
||
(
@@
-2187,8
+2187,6
@@
export default class ChessRules {
underCheck(square_s, oppCol) {
if (this.options["taking"] || this.options["dark"])
return false;
underCheck(square_s, oppCol) {
if (this.options["taking"] || this.options["dark"])
return false;
- if (!Array.isArray(square_s[0]))
- square_s = [square_s];
return square_s.some(sq => this.underAttack(sq, oppCol));
}
return square_s.some(sq => this.underAttack(sq, oppCol));
}