projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Emergo: no simple moves in entering stage
[vchess.git]
/
client
/
src
/
variants
/
Bario.js
diff --git
a/client/src/variants/Bario.js
b/client/src/variants/Bario.js
index
fcdb44d
..
f344d3a
100644
(file)
--- a/
client/src/variants/Bario.js
+++ b/
client/src/variants/Bario.js
@@
-262,7
+262,6
@@
export class BarioRules extends ChessRules {
const color = this.turn;
if (this.movesCount <= 1) {
// Just put the king on the board
const color = this.turn;
if (this.movesCount <= 1) {
// Just put the king on the board
- let moves = [];
const firstRank = (color == 'w' ? 7 : 0);
return [...Array(8)].map((x, j) => {
return new Move({
const firstRank = (color == 'w' ? 7 : 0);
return [...Array(8)].map((x, j) => {
return new Move({
@@
-293,6
+292,7
@@
export class BarioRules extends ChessRules {
}
filterValid(moves) {
}
filterValid(moves) {
+ if (this.movesCount <= 1) return moves;
const color = this.turn;
return moves.filter(m => {
if (m.vanish.length == 0) return true;
const color = this.turn;
return moves.filter(m => {
if (m.vanish.length == 0) return true;
@@
-519,7
+519,7
@@
export class BarioRules extends ChessRules {
this.movesCount--;
this.postUndo(move);
};
this.movesCount--;
this.postUndo(move);
};
- if (this.movesCount <= 2) toPrevPlayer();
+ if (this.movesCount <= 2
&& move.appear[0].p == V.KING
) toPrevPlayer();
else if (move.vanish.length == 0) {
this.reserve[this.turn][move.start.p]++;
this.subTurn = move.turn[1];
else if (move.vanish.length == 0) {
this.reserve[this.turn][move.start.p]++;
this.subTurn = move.turn[1];