projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4e9bb9
)
Maybe we can finally get rid of these code bits which shouldn't be required ?
author
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 2 Jun 2022 19:01:10 +0000
(21:01 +0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 2 Jun 2022 19:01:10 +0000
(21:01 +0200)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
f73700b
..
0d7b703
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2154,9
+2154,7
@@
export default class ChessRules {
playVisual(move, r) {
move.vanish.forEach(v => {
playVisual(move, r) {
move.vanish.forEach(v => {
- // 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].remove();
this.g_pieces[v.x][v.y] = null;
});
let chessboard =
this.g_pieces[v.x][v.y] = null;
});
let chessboard =
@@
-2203,10
+2201,6
@@
export default class ChessRules {
return;
}
let initPiece = this.getDomPiece(move.start.x, move.start.y);
return;
}
let initPiece = this.getDomPiece(move.start.x, move.start.y);
- if (!initPiece) { //TODO this shouldn't be required
- callback();
- return;
- }
// NOTE: cloning generally not required, but light enough, and simpler
let movingPiece = initPiece.cloneNode();
initPiece.style.opacity = "0";
// NOTE: cloning generally not required, but light enough, and simpler
let movingPiece = initPiece.cloneNode();
initPiece.style.opacity = "0";