mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 08:43:53 +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 skill = Skills[skillName];
|
||||||
const currentLevel = this.skills[skillName];
|
const currentLevel = this.skills[skillName] ?? 0;
|
||||||
if (currentLevel == null) {
|
|
||||||
return skill.calculateCost(0, count);
|
if (skill.maxLvl !== 0 && currentLevel + count > skill.maxLvl) {
|
||||||
} else if (currentLevel + count > skill.maxLvl) {
|
|
||||||
return Infinity;
|
return Infinity;
|
||||||
} else {
|
|
||||||
return skill.calculateCost(currentLevel, count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return skill.calculateCost(currentLevel, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {
|
upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user