From d7ac7f8399469574aaa90cabdb25eeeb2c6887cb Mon Sep 17 00:00:00 2001 From: David Grinberg Date: Wed, 27 Apr 2022 00:48:22 -0400 Subject: [PATCH 1/2] Expose makeProducts on NSDivision interface --- src/NetscriptFunctions/Corporation.ts | 2 ++ src/ScriptEditor/NetscriptDefinitions.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/NetscriptFunctions/Corporation.ts b/src/NetscriptFunctions/Corporation.ts index 6ff8cb3c3..149e45e37 100644 --- a/src/NetscriptFunctions/Corporation.ts +++ b/src/NetscriptFunctions/Corporation.ts @@ -295,6 +295,7 @@ export function NetscriptCorporation( if (office === 0) continue; cities.push(office.loc); } + return { name: division.name, type: division.type, @@ -309,6 +310,7 @@ export function NetscriptCorporation( upgrades: division.upgrades.slice(), cities: cities, products: division.products === undefined ? [] : Object.keys(division.products), + makesProducts: getDivision(division.name).makesProducts, }; } diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index e98b03557..97f7482b9 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -7202,6 +7202,8 @@ interface Division { cities: string[]; /** Products developed by this division */ products: string[]; + /** Whether the industry this division is in is capable of making products */ + makesProducts: boolean; } /** From 828629b713d25986efd44b2d40a33556ae385fe7 Mon Sep 17 00:00:00 2001 From: DavidGrinberg Date: Wed, 27 Apr 2022 09:37:02 -0400 Subject: [PATCH 2/2] Update src/NetscriptFunctions/Corporation.ts Co-authored-by: Jack --- src/NetscriptFunctions/Corporation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetscriptFunctions/Corporation.ts b/src/NetscriptFunctions/Corporation.ts index 149e45e37..7ef0dfe03 100644 --- a/src/NetscriptFunctions/Corporation.ts +++ b/src/NetscriptFunctions/Corporation.ts @@ -310,7 +310,7 @@ export function NetscriptCorporation( upgrades: division.upgrades.slice(), cities: cities, products: division.products === undefined ? [] : Object.keys(division.products), - makesProducts: getDivision(division.name).makesProducts, + makesProducts: division.makesProducts, }; }