fix(xp): floor fractional xp before resolving level
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
03c76154da
commit
6fce7c4f86
1 changed files with 3 additions and 1 deletions
|
|
@ -23,7 +23,9 @@ export type ResolvedLevel = {
|
|||
* current bracket: (xp - currentLevelXP) / (nextLevelXP - currentLevelXP).
|
||||
* At the max level the bar sits at 100%.
|
||||
*/
|
||||
export function resolveLevel(xp: number, levels: ExperienceLevel[]): ResolvedLevel {
|
||||
export function resolveLevel(rawXp: number, levels: ExperienceLevel[]): ResolvedLevel {
|
||||
const xp = Math.floor(rawXp);
|
||||
|
||||
if (levels.length === 0) {
|
||||
return {
|
||||
levelName: "Unknown",
|
||||
|
|
|
|||
Loading…
Reference in a new issue