mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 21:53:50 +01:00
Some corp fixes (#236)
This commit is contained in:
parent
ce1879fb62
commit
14e50e5533
@ -462,10 +462,9 @@ export const achievements: Record<string, Achievement> = {
|
|||||||
Condition: (): boolean => {
|
Condition: (): boolean => {
|
||||||
if (Player.corporation === null) return false;
|
if (Player.corporation === null) return false;
|
||||||
for (const d of Player.corporation.divisions) {
|
for (const d of Player.corporation.divisions) {
|
||||||
for (const o of Object.values(d.offices)) {
|
let totalEmployees = 0;
|
||||||
if (o === 0) continue;
|
for (const o of Object.values(d.offices)) if (o && o.totalEmployees) totalEmployees += o.totalEmployees;
|
||||||
if (o.totalEmployees >= 3000) return true;
|
if (totalEmployees >= 3000) return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
@ -233,7 +233,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
|||||||
const division = getDivision(divisionName);
|
const division = getDivision(divisionName);
|
||||||
if (!checkEnum(CityName, cityName)) throw new Error(`Invalid city name '${cityName}'`);
|
if (!checkEnum(CityName, cityName)) throw new Error(`Invalid city name '${cityName}'`);
|
||||||
const warehouse = division.warehouses[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;
|
return warehouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,6 +848,8 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
|||||||
},
|
},
|
||||||
goPublic: (ctx) => (_numShares) => {
|
goPublic: (ctx) => (_numShares) => {
|
||||||
checkAccess(ctx);
|
checkAccess(ctx);
|
||||||
|
const corporation = getCorporation();
|
||||||
|
if (corporation.public) throw helpers.makeRuntimeErrorMsg(ctx, "corporation is already public");
|
||||||
const numShares = helpers.number(ctx, "numShares", _numShares);
|
const numShares = helpers.number(ctx, "numShares", _numShares);
|
||||||
return goPublic(numShares);
|
return goPublic(numShares);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user