projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4a3990
)
Initiale refactoring --> getPotentialMove_s(start, end)
main
author
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 24 Jun 2026 22:44:09 +0000
(
00:44
+0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 24 Jun 2026 22:44:09 +0000
(
00:44
+0200)
js/base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/js/base_rules.js
b/js/base_rules.js
index
a6c2c59
..
c3daac7
100644
(file)
--- a/
js/base_rules.js
+++ b/
js/base_rules.js
@@
-972,8
+972,7
@@
export default class ChessRules {
(landingElt ? this.idToCoords(landingElt.id) : undefined);
if (cd) {
// NOTE: clearly suboptimal, but much easier, and not a big deal.
- const potentialMoves = this.getPotentialMovesFrom([x, y])
- .filter(m => m.end.x == cd.x && m.end.y == cd.y);
+ const potentialMoves = this.getPotentialMove_s([x, y], [cd.x, cd.y]);
const moves = this.filterValid(potentialMoves);
if (moves.length >= 2)
this.showChoices(moves, r);