mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
Some corp fixes (#236)
This commit is contained in:
@@ -233,7 +233,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
const division = getDivision(divisionName);
|
||||
if (!checkEnum(CityName, cityName)) throw new Error(`Invalid city name '${cityName}'`);
|
||||
const warehouse = division.warehouses[cityName];
|
||||
if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);
|
||||
if (warehouse === 0) throw new Error(`${division.name} does not have a warehouse in '${cityName}'`);
|
||||
return warehouse;
|
||||
}
|
||||
|
||||
@@ -848,6 +848,8 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
},
|
||||
goPublic: (ctx) => (_numShares) => {
|
||||
checkAccess(ctx);
|
||||
const corporation = getCorporation();
|
||||
if (corporation.public) throw helpers.makeRuntimeErrorMsg(ctx, "corporation is already public");
|
||||
const numShares = helpers.number(ctx, "numShares", _numShares);
|
||||
return goPublic(numShares);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user