From 56d3ef01e0624aec392ec926d830743e87bdbd9a Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Thu, 25 Jun 2026 00:44:09 +0200 Subject: [PATCH] Initiale refactoring --> getPotentialMove_s(start, end) --- js/base_rules.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/base_rules.js b/js/base_rules.js index a6c2c59..c3daac7 100644 --- 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); -- 2.53.0