projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
adf7c65
)
Minor fixes
author
Benjamin Auder
<benjamin.auder@somewhere>
Sun, 29 May 2022 11:47:08 +0000
(13:47 +0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Sun, 29 May 2022 11:47:08 +0000
(13:47 +0200)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
7191c56
..
75545c2
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-98,7
+98,7
@@
export default class ChessRules {
this.options["teleport"] && this.subTurnTeleport == 2 &&
this.board[coords.x][coords.y] == ""
) {
this.options["teleport"] && this.subTurnTeleport == 2 &&
this.board[coords.x][coords.y] == ""
) {
-
return
new Move({
+
let res =
new Move({
start: {x: this.captured.x, y: this.captured.y},
appear: [
new PiPo({
start: {x: this.captured.x, y: this.captured.y},
appear: [
new PiPo({
@@
-108,9
+108,10
@@
export default class ChessRules {
p: this.captured.p
})
],
p: this.captured.p
})
],
- vanish: [],
- drag: {c: this.captured.c, p: this.captured.p}
+ vanish: []
});
});
+ res.drag = {c: this.captured.c, p: this.captured.p};
+ return res;
}
return null;
}
}
return null;
}
@@
-549,7
+550,7
@@
export default class ChessRules {
cbHeight = Math.min(window.innerHeight, 767);
cbWidth = cbHeight * this.size.ratio;
}
cbHeight = Math.min(window.innerHeight, 767);
cbWidth = cbHeight * this.size.ratio;
}
- if (this.
r
eserve) {
+ if (this.
hasR
eserve) {
const sqSize = cbWidth / this.size.y;
// NOTE: allocate space for reserves (up/down) even if they are empty
// Cannot use getReserveSquareSize() here, but sqSize is an upper bound.
const sqSize = cbWidth / this.size.y;
// NOTE: allocate space for reserves (up/down) even if they are empty
// Cannot use getReserveSquareSize() here, but sqSize is an upper bound.
@@
-648,7
+649,7
@@
export default class ChessRules {
}
}
}
}
}
}
- if (this.
r
eserve)
+ if (this.
hasR
eserve)
this.re_drawReserve(['w', 'b'], r);
}
this.re_drawReserve(['w', 'b'], r);
}
@@
-801,7
+802,7
@@
export default class ChessRules {
}
}
}
}
}
}
- if (this.
r
eserve)
+ if (this.
hasR
eserve)
this.rescaleReserve(newR);
}
this.rescaleReserve(newR);
}
@@
-1207,7
+1208,7
@@
export default class ChessRules {
getDropMovesFrom([c, p]) {
// NOTE: by design, this.reserve[c][p] >= 1 on user click
getDropMovesFrom([c, p]) {
// NOTE: by design, this.reserve[c][p] >= 1 on user click
- // (but not necessarily otherwise)
+ // (but not necessarily otherwise
: atLeastOneMove() etc
)
if (this.reserve[c][p] == 0)
return [];
let moves = [];
if (this.reserve[c][p] == 0)
return [];
let moves = [];