projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hopefully Eightpieces is less buggish now
[vchess.git]
/
client
/
src
/
base_rules.js
diff --git
a/client/src/base_rules.js
b/client/src/base_rules.js
index
890601d
..
326da6e
100644
(file)
--- a/
client/src/base_rules.js
+++ b/
client/src/base_rules.js
@@
-238,9
+238,11
@@
export const ChessRules = class ChessRules {
// On which squares is color under check ? (for interface)
getCheckSquares(color) {
// On which squares is color under check ? (for interface)
getCheckSquares(color) {
- return this.isAttacked(this.kingPos[color], [V.GetOppCol(color)])
- ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate!
- : [];
+ return (
+ this.underCheck(color)
+ ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate!
+ : []
+ );
}
/////////////
}
/////////////