projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(Hopefully) better (cleaner) authentication mechanism now
[vchess.git]
/
client
/
src
/
variants
/
Teleport2.js
diff --git
a/client/src/variants/Teleport2.js
b/client/src/variants/Teleport2.js
index
4e0fe23
..
23bd213
100644
(file)
--- a/
client/src/variants/Teleport2.js
+++ b/
client/src/variants/Teleport2.js
@@
-13,7
+13,7
@@
export class Teleport2Rules extends Teleport1Rules {
}
postPlay(move) {
}
postPlay(move) {
- if (move.vaish.length > 0) {
+ if (move.va
n
ish.length > 0) {
// Standard method:
if (move.appear[0].p == V.KING)
this.kingPos[move.appear[0].c] = [move.appear[0].x, move.appear[0].y];
// Standard method:
if (move.appear[0].p == V.KING)
this.kingPos[move.appear[0].c] = [move.appear[0].x, move.appear[0].y];
@@
-23,11
+23,11
@@
export class Teleport2Rules extends Teleport1Rules {
updateCastleFlags(move) {
// Standard method: TODO = find a better way... (not rewriting)
updateCastleFlags(move) {
// Standard method: TODO = find a better way... (not rewriting)
- const c =
color || V.GetOppCol(this.turn)
;
+ const c =
move.vanish[0].c
;
const firstRank = (c == "w" ? V.size.x - 1 : 0);
const oppCol = this.turn;
const oppFirstRank = V.size.x - 1 - firstRank;
const firstRank = (c == "w" ? V.size.x - 1 : 0);
const oppCol = this.turn;
const oppFirstRank = V.size.x - 1 - firstRank;
- if (
piece
== V.KING && move.appear.length > 0)
+ if (
move.vanish[0].p
== V.KING && move.appear.length > 0)
this.castleFlags[c] = [V.size.y, V.size.y];
else if (
move.start.x == firstRank &&
this.castleFlags[c] = [V.size.y, V.size.y];
else if (
move.start.x == firstRank &&