Skip to content

Commit

Permalink
Actually fix the rank score threshold bug for real this time
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyanreyer committed Jun 3, 2023
1 parent 413f571 commit 91999c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/js/game.mjs
Expand Up @@ -367,8 +367,10 @@ Alpine.store("game", {

for (let i = ranks.length - 1; i >= 0; --i) {
const rank = ranks[i];
const rankThresholdScore = rank.percent * totalPossibleScore;
if (newScore >= rankThresholdScore || i === 0) {
if (
newScore >= Math.floor(rank.percent * totalPossibleScore) ||
i === 0
) {
this.currentRank = rank;
this.nextRank = ranks[i + 1];
break;
Expand Down
2 changes: 1 addition & 1 deletion src/pwa/serviceWorker.js
@@ -1,4 +1,4 @@
const cacheName = "open-spelling-bee-1.2.4";
const cacheName = "open-spelling-bee-1.2.5";
const cacheFiles = [
"/",
"/index.html",
Expand Down

0 comments on commit 91999c4

Please sign in to comment.