Skip to content

Commit

Permalink
fix Dungeons when player is missing keys (#598)
Browse files Browse the repository at this point in the history
* fix best runs

* Fix Users never played Dungeons

---------

Co-authored-by: Jacob <admin@kath.lol>
  • Loading branch information
Johannes7k75 and Kathund authored Aug 9, 2024
1 parent 01646d1 commit fd38862
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/SkyblockUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,16 @@ function getCompletions(data) {

function getDungeonsFloor(data, type, floor) {
return {
fastestRun: (data?.dungeons?.dungeon_types[type]?.best_runs[floor] ?? []).sort(
fastestRun: (data?.dungeons?.dungeon_types?.[type]?.best_runs?.[floor] ?? []).sort(
(a, b) => a?.elapsed_time - b?.elapsed_time
)[0],
fastestSRun: (data?.dungeons?.dungeon_types[type]?.best_runs[floor] ?? [])
fastestSRun: (data?.dungeons?.dungeon_types?.[type]?.best_runs?.[floor] ?? [])
.filter((run) => 270 >= run?.score_exploration + run?.score_speed + run?.score_skill + run?.score_bonus)
.sort((a, b) => a?.elapsed_time - b?.elapsed_time)[0],
fastestSPlusRun: (data?.dungeons?.dungeon_types[type]?.best_runs[floor] ?? [])
fastestSPlusRun: (data?.dungeons?.dungeon_types?.[type]?.best_runs?.[floor] ?? [])
.filter((run) => 300 >= run?.score_exploration + run?.score_speed + run?.score_skill + run?.score_bonus)
.sort((a, b) => a?.elapsed_time - b?.elapsed_time)[0],
completions: data?.dungeonXp?.dungeon_types[type]?.tier_completions[floor] ?? 0
completions: data?.dungeonXp?.dungeon_types?.[type]?.tier_completions[floor] ?? 0
};
}

Expand Down

0 comments on commit fd38862

Please sign in to comment.