X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=base_rules.js;h=8eed3d35250e521b0a6cb78d4a85d67222c8341d;hp=01a2c2424816144c19a3ddf7d6c5c7cdeaad4dc4;hb=d6d0a46e5c8c1d9176f4a9e9c44a4b5f2ed791e7;hpb=9b76053854ec41e9f4d52aa5ddc51ea4c4c33ab6 diff --git a/base_rules.js b/base_rules.js index 01a2c24..8eed3d3 100644 --- a/base_rules.js +++ b/base_rules.js @@ -2420,7 +2420,11 @@ export default class ChessRules { } // What is the score ? (Interesting if game is over) - getCurrentScore(move) { + getCurrentScore(move_s) { + const move = move_s[move_s.length - 1]; + // Shortcut in case the score was computed before: + if (move.result) + return move.result; const color = this.turn; const oppCol = C.GetOppCol(color); const kingPos = {