use a local variable to store player's name

This commit is contained in:
Laurent Mazet 2020-11-24 13:21:39 +01:00
parent 899cb609fa
commit a6d3dc6ed8
1 changed files with 3 additions and 5 deletions

View File

@ -1924,10 +1924,8 @@
totalScore += getSetting("PREMIUM_SEVEN_TILES");
}
/* Ѕcore player who pressed the button */
if (!getSetting("SCORE_LAST_PLAYER")) {
lastPlayer = getSetting("PlayerName");
}
/* Ѕcore last player or the one who pressed the button */
const playerName = getSetting("SCORE_LAST_PLAYER") ? lastPlayer : getSetting("PlayerName");
myChoice(
format(_("{0} points will be added to:"), totalScore), {
@ -1947,7 +1945,7 @@
score: parseInt(getScoreCell(name).textContent) + totalScore
}]);
},
lastPlayer || currentPlayer || getSetting("PlayerName")
playerName || lastPlayer || currentPlayer || getSetting("PlayerName")
);
}