projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ea8417f
)
Fix incheck by pawns for checkered
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 19 Nov 2018 10:08:25 +0000
(11:08 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 19 Nov 2018 10:08:25 +0000
(11:08 +0100)
TODO
patch
|
blob
|
blame
|
history
public/javascripts/base_rules.js
patch
|
blob
|
blame
|
history
public/javascripts/components/game.js
patch
|
blob
|
blame
|
history
public/javascripts/variants/Checkered.js
patch
|
blob
|
blame
|
history
diff --git
a/TODO
b/TODO
index
aeb537d
..
e9d0cc5
100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-3,4
+3,3
@@
Tooltip text should fade (even when mouse stay on it, especially for small scree
Checkered stage 2: switch button at reserve position (or on top).
Mode expert: game.js, button on top (with online indicator)
Turn indicator on top too (black or white)
Checkered stage 2: switch button at reserve position (or on top).
Mode expert: game.js, button on top (with online indicator)
Turn indicator on top too (black or white)
-incheck by checkered pawns: not marked (because of turn changed?)
diff --git
a/public/javascripts/base_rules.js
b/public/javascripts/base_rules.js
index
7f4052a
..
11de147
100644
(file)
--- a/
public/javascripts/base_rules.js
+++ b/
public/javascripts/base_rules.js
@@
-712,7
+712,7
@@
class ChessRules
VariantRules.PlayOnBoard(this.board, move);
}
VariantRules.PlayOnBoard(this.board, move);
}
- undo(move
, ingame
)
+ undo(move)
{
VariantRules.UndoOnBoard(this.board, move);
this.epSquares.pop();
{
VariantRules.UndoOnBoard(this.board, move);
this.epSquares.pop();
diff --git
a/public/javascripts/components/game.js
b/public/javascripts/components/game.js
index
bd3a187
..
ab86057
100644
(file)
--- a/
public/javascripts/components/game.js
+++ b/
public/javascripts/components/game.js
@@
-549,7
+549,7
@@
Vue.component('my-game', {
{
const oppCol = this.vr.turn;
const lastMove = moves[moves.length-1];
{
const oppCol = this.vr.turn;
const lastMove = moves[moves.length-1];
- this.vr.undo(lastMove
, "ingame"
);
+ this.vr.undo(lastMove);
this.incheck = this.vr.getCheckSquares(lastMove, oppCol);
this.vr.play(lastMove, "ingame");
}
this.incheck = this.vr.getCheckSquares(lastMove, oppCol);
this.vr.play(lastMove, "ingame");
}
diff --git
a/public/javascripts/variants/Checkered.js
b/public/javascripts/variants/Checkered.js
index
3626822
..
a74143b
100644
(file)
--- a/
public/javascripts/variants/Checkered.js
+++ b/
public/javascripts/variants/Checkered.js
@@
-338,11
+338,13
@@
class CheckeredRules extends ChessRules
getCheckSquares(move, c)
{
this.play(move);
getCheckSquares(move, c)
{
this.play(move);
+ this.moves.push(move); //artifically change turn, for checkered pawns (TODO)
const kingAttacked = this.isAttacked(this.kingPos[c], this.getOppCol(c))
|| this.isAttacked(this.kingPos[c], 'c');
let res = kingAttacked
? [ JSON.parse(JSON.stringify(this.kingPos[c])) ] //need to duplicate!
: [ ];
const kingAttacked = this.isAttacked(this.kingPos[c], this.getOppCol(c))
|| this.isAttacked(this.kingPos[c], 'c');
let res = kingAttacked
? [ JSON.parse(JSON.stringify(this.kingPos[c])) ] //need to duplicate!
: [ ];
+ this.moves.pop();
this.undo(move);
return res;
}
this.undo(move);
return res;
}