BUGFIX: Fix skillMaxUpgradeCount returning 1 at extreme skill levels (#2611)

This commit is contained in:
Lee Stutzman
2026-04-03 03:06:44 +01:00
committed by GitHub
parent 7425d8a8fd
commit 5fc54809de
2 changed files with 39 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ export class Skill {
}
calculateMaxUpgradeCount(currentLevel: number, cost: PositiveNumber): number {
// At extreme levels, floating-point precision loss makes currentLevel + 1 === currentLevel,
// causing calculateCost to return 0. No upgrade is possible in this case.
if (this.calculateCost(currentLevel, 1 as PositiveInteger) <= 0) return 0;
/**
* Define:
* - x = count