Merge pull request #4084 from Rasmoh/expose_exports

CORPORATION API: FIX #3655 Expose exports from Material
This commit is contained in:
hydroflame
2022-09-23 00:46:28 -03:00
committed by GitHub
2 changed files with 20 additions and 1 deletions
+4
View File
@@ -360,6 +360,9 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
const materialName = helpers.string(ctx, "materialName", _materialName);
const material = getMaterial(divisionName, cityName, materialName);
const corporation = getCorporation();
const exports = material.exp.map((e) => {
return { div: e.ind, loc: e.city, amt: e.amt };
});
return {
cost: material.bCost,
sCost: material.sCost,
@@ -370,6 +373,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,
prod: material.prd,
sell: material.sll,
exp: exports,
};
},
getProduct: