mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
Merge pull request #4069 from Mughur/corp
API: Corp functions now return copy of constant arrays instead of the original
This commit is contained in:
commit
5101b345ec
@ -877,20 +877,25 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
return {
|
||||
...warehouseAPI,
|
||||
...officeAPI,
|
||||
getMaterialNames: () => (): string[] => {
|
||||
return CorporationConstants.AllMaterials;
|
||||
getMaterialNames: (ctx: NetscriptContext) => (): string[] => {
|
||||
checkAccess(ctx);
|
||||
return [...CorporationConstants.AllMaterials];
|
||||
},
|
||||
getIndustryTypes: () => (): string[] => {
|
||||
return CorporationConstants.AllIndustryTypes;
|
||||
getIndustryTypes: (ctx: NetscriptContext) => (): string[] => {
|
||||
checkAccess(ctx);
|
||||
return [...CorporationConstants.AllIndustryTypes];
|
||||
},
|
||||
getUnlockables: () => (): string[] => {
|
||||
return CorporationConstants.AllUnlocks;
|
||||
getUnlockables: (ctx: NetscriptContext) => (): string[] => {
|
||||
checkAccess(ctx);
|
||||
return [...CorporationConstants.AllUnlocks];
|
||||
},
|
||||
getUpgradeNames: () => (): string[] => {
|
||||
return CorporationConstants.AllUpgrades;
|
||||
getUpgradeNames: (ctx: NetscriptContext) => (): string[] => {
|
||||
checkAccess(ctx);
|
||||
return [...CorporationConstants.AllUpgrades];
|
||||
},
|
||||
getResearchNames: () => (): string[] => {
|
||||
return CorporationConstants.AllResearch;
|
||||
getResearchNames: (ctx: NetscriptContext) => (): string[] => {
|
||||
checkAccess(ctx);
|
||||
return [...CorporationConstants.AllResearch];
|
||||
},
|
||||
expandIndustry:
|
||||
(ctx: NetscriptContext) =>
|
||||
|
Loading…
Reference in New Issue
Block a user