mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
Merge pull request #3192 from gianfun/check-corp-upgrade-before-purchase
Check before unlocking corp upgrade
This commit is contained in:
commit
04d45a1f0e
@ -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