mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Check before unlocking corp upgrade
This commit is contained in:
parent
f801dc6d8a
commit
8be65faf9f
@ -64,6 +64,9 @@ export function UnlockUpgrade(corporation: ICorporation, upgrade: CorporationUnl
|
||||
if (corporation.funds < upgrade[1]) {
|
||||
throw new Error("Insufficient funds");
|
||||
}
|
||||
if(corporation.unlockUpgrades[upgrade[0]] === 1){
|
||||
throw new Error(`You have already unlocked the ${upgrade[2]} upgrade!`);
|
||||
}
|
||||
corporation.unlock(upgrade);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user