projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6f74b81
)
Add a temporary patch for so far unexplained bug
author
Benjamin Auder
<benjamin.auder@somewhere>
Fri, 22 Apr 2022 05:57:29 +0000
(07:57 +0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Fri, 22 Apr 2022 05:57:29 +0000
(07:57 +0200)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
6efce02
..
e987492
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2189,7
+2189,9
@@
export default class ChessRules {
playVisual(move, r) {
move.vanish.forEach(v => {
if (!this.enlightened || this.enlightened[v.x][v.y]) {
playVisual(move, r) {
move.vanish.forEach(v => {
if (!this.enlightened || this.enlightened[v.x][v.y]) {
- this.g_pieces[v.x][v.y].remove();
+ // TODO: next "if" shouldn't be required
+ if (this.g_pieces[v.x][v.y])
+ this.g_pieces[v.x][v.y].remove();
this.g_pieces[v.x][v.y] = null;
}
});
this.g_pieces[v.x][v.y] = null;
}
});
@@
-2242,6
+2244,11
@@
export default class ChessRules {
const dropMove = (typeof i1 == "string");
const startArray = (dropMove ? this.r_pieces : this.g_pieces);
let startPiece = startArray[i1][j1];
const dropMove = (typeof i1 == "string");
const startArray = (dropMove ? this.r_pieces : this.g_pieces);
let startPiece = startArray[i1][j1];
+ // TODO: next "if" shouldn't be required
+ if (!startPiece) {
+ callback();
+ return;
+ }
let chessboard =
document.getElementById(this.containerId).querySelector(".chessboard");
const clonePiece = (
let chessboard =
document.getElementById(this.containerId).querySelector(".chessboard");
const clonePiece = (