aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-19 19:09:12 +0000
committermat <github@matdoes.dev>2022-05-19 19:09:12 +0000
commita7d20149e6cfebec77b5c0ecc95ca55d23d02e94 (patch)
tree6ca5589339fdfd6ab3c7a60457f7a513d5a98a90 /src/cleaners/skyblock
parent6dde7dcc4926288bf710bb40b6807ec596692085 (diff)
downloadskyblock-api-a7d20149e6cfebec77b5c0ecc95ca55d23d02e94.tar.gz
skyblock-api-a7d20149e6cfebec77b5c0ecc95ca55d23d02e94.tar.bz2
skyblock-api-a7d20149e6cfebec77b5c0ecc95ca55d23d02e94.zip
fix
Diffstat (limited to 'src/cleaners/skyblock')
-rw-r--r--src/cleaners/skyblock/skills.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cleaners/skyblock/skills.ts b/src/cleaners/skyblock/skills.ts
index b70b2ea..9f53e5a 100644
--- a/src/cleaners/skyblock/skills.ts
+++ b/src/cleaners/skyblock/skills.ts
@@ -165,19 +165,19 @@ function skillFromLevel(id: string, level: number | undefined): Skill {
}
}
-function skillsFromSkyBlockAchievements(achievements: CleanFullPlayer['achievements']['skyblock']): Skills {
+function skillsFromSkyBlockAchievements(achievements: CleanFullPlayer['achievements']): Skills {
return {
apiEnabled: false,
list: [
- skillFromLevel('fishing', achievements['angler']),
- skillFromLevel('enchanting', achievements['augmentation']),
- skillFromLevel('combat', achievements['combat']),
- skillFromLevel('alchemy', achievements['concoctor']),
- skillFromLevel('taming', achievements['domesticator']),
- skillFromLevel('dungeoneering', achievements['dungeoneer']),
- skillFromLevel('mining', achievements['excavator']),
- skillFromLevel('foraging', achievements['gatherer']),
- skillFromLevel('farming', achievements['harvester'])
+ skillFromLevel('fishing', achievements.tiered.find(a => a.id === 'angler')?.value ?? 0),
+ skillFromLevel('enchanting', achievements.tiered.find(a => a.id === 'augmentation')?.value ?? 0),
+ skillFromLevel('combat', achievements.tiered.find(a => a.id === 'combat')?.value ?? 0),
+ skillFromLevel('alchemy', achievements.tiered.find(a => a.id === 'concoctor')?.value ?? 0),
+ skillFromLevel('taming', achievements.tiered.find(a => a.id === 'domesticator')?.value ?? 0),
+ skillFromLevel('dungeoneering', achievements.tiered.find(a => a.id === 'dungeoneer')?.value ?? 0),
+ skillFromLevel('mining', achievements.tiered.find(a => a.id === 'excavator')?.value ?? 0),
+ skillFromLevel('foraging', achievements.tiered.find(a => a.id === 'gatherer')?.value ?? 0),
+ skillFromLevel('farming', achievements.tiered.find(a => a.id === 'harvester')?.value ?? 0)
]
}
}
@@ -226,7 +226,7 @@ export async function cleanSkills(data: typedHypixelApi.SkyBlockProfileMember, p
// if the player has no skills but has kills, we can assume they have the skills api off
// (we check kills to know whether the profile is actually used, this is kinda arbitrary)
if (skills.length === 0 && 'stats' in data && Object.keys(data.stats).includes('kills')) {
- return skillsFromSkyBlockAchievements(player.achievements.skyblock)
+ return skillsFromSkyBlockAchievements(player.achievements)
}
constants.addSkills(skillNamesFound)