mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 06:32:26 +01:00
BUGFIX: Fixed bug that returned Infinity cost for most skills (#1084)
This commit is contained in:
parent
9697a82e0c
commit
6bd50e6f24
@ -2299,14 +2299,13 @@ export class Bladeburner {
|
||||
}
|
||||
|
||||
const skill = Skills[skillName];
|
||||
const currentLevel = this.skills[skillName];
|
||||
if (currentLevel == null) {
|
||||
return skill.calculateCost(0, count);
|
||||
} else if (currentLevel + count > skill.maxLvl) {
|
||||
const currentLevel = this.skills[skillName] ?? 0;
|
||||
|
||||
if (skill.maxLvl !== 0 && currentLevel + count > skill.maxLvl) {
|
||||
return Infinity;
|
||||
} else {
|
||||
return skill.calculateCost(currentLevel, count);
|
||||
}
|
||||
|
||||
return skill.calculateCost(currentLevel, count);
|
||||
}
|
||||
|
||||
upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user