Skip to content

Commit

Permalink
Fix comparison bug in #159 (#179)
Browse files Browse the repository at this point in the history
* Fix comparison bug in #159

bool should be an int

* Prettier
  • Loading branch information
ekzhang authored Dec 29, 2024
1 parent fd1986c commit a7e8c7a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,9 @@ export function computeState(gameData, gameMode = "normal") {
};

if (gameData.events) {
const events = Object.entries(gameData.events)
.sort(([k1, e1], [k2, e2]) => {
return e1.time !== e2.time ? e1.time - e2.time : k1 < k2;
})
.map(([, e]) => e);
const events = Object.values(gameData.events).sort(
(e1, e2) => e1.time - e2.time,
);
for (const event of events) {
if (gameMode === "normal" || gameMode === "setjr")
processEventNormal(internalGameState, event);
Expand Down

0 comments on commit a7e8c7a

Please sign in to comment.