From c71f5cd982f96a726ff90f930f37108f18c6f352 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 27 Mar 2022 15:50:39 -0500 Subject: Add pets --- src/cleaners/skyblock/skills.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cleaners/skyblock/skills.ts') diff --git a/src/cleaners/skyblock/skills.ts b/src/cleaners/skyblock/skills.ts index c69acd0..a186232 100644 --- a/src/cleaners/skyblock/skills.ts +++ b/src/cleaners/skyblock/skills.ts @@ -1,4 +1,5 @@ import typedHypixelApi from 'typed-hypixel-api' +import { levelFromXpTable } from '../../util' export interface Skill { name: string @@ -131,8 +132,7 @@ const skillsDefaultMaxLevel: number = 50 */ export function levelForSkillXp(xp: number, maxLevel: number) { const xpTable = (maxLevel <= 25 ? skillXpTableEasier : skillXpTable).slice(0, maxLevel) - const skillLevel = [...xpTable].reverse().findIndex(levelXp => xp >= levelXp) - return skillLevel === -1 ? 0 : xpTable.length - skillLevel + return levelFromXpTable(xp, xpTable) } export async function cleanSkills(data: typedHypixelApi.SkyBlockProfileMember): Promise { -- cgit