From a389b515dff4ab71ddcca7d47822236391db6abd Mon Sep 17 00:00:00 2001 From: phyzical Date: Sat, 5 Mar 2022 13:05:37 +0800 Subject: [PATCH 1/4] fix for work in progress modal when augmenting * added an early out to turns a basic error for the work modal when the current work faction to show the faction or faction not found --- src/ui/WorkInProgressRoot.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index d43843c85..a2ebf2b24 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -34,6 +34,18 @@ export function WorkInProgressRoot(): React.ReactElement { const player = use.Player(); const router = use.Router(); const faction = Factions[player.currentWorkFactionName]; + if (!faction) { + return ( + + + + Sorry, Something has gone wrong you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time + + + + ) + } + if (player.workType == CONSTANTS.WorkTypeFaction) { function cancel(): void { router.toFaction(faction); From 0e1929b561c5828b6d792fb2b49c1341bc71b22e Mon Sep 17 00:00:00 2001 From: phyzical Date: Sat, 5 Mar 2022 13:14:28 +0800 Subject: [PATCH 2/4] added early out for when it goes wrong here too --- src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index 192c52039..df0d03308 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -933,6 +933,8 @@ export function startFactionSecurityWork(this: IPlayer, faction: Faction): void export function workForFaction(this: IPlayer, numCycles: number): boolean { const faction = Factions[this.currentWorkFactionName]; + if (!faction) return false + //Constantly update the rep gain rate switch (this.factionWorkType) { case CONSTANTS.FactionWorkHacking: From d4f5f54fb6d87d47aadf1e1e3049f8a884f2616e Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 6 Mar 2022 12:42:35 +0800 Subject: [PATCH 3/4] Update src/ui/WorkInProgressRoot.tsx Co-authored-by: ApamNapat --- src/ui/WorkInProgressRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index a2ebf2b24..1c56ad559 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -39,7 +39,7 @@ export function WorkInProgressRoot(): React.ReactElement { - Sorry, Something has gone wrong you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time + Something has gone wrong, you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time. From a2fae480f3f378c8ba510d8a2e9d2181d1d894ec Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 8 Mar 2022 17:32:03 +0800 Subject: [PATCH 4/4] Update src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx --- src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index df0d03308..c08b4c75f 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -933,7 +933,7 @@ export function startFactionSecurityWork(this: IPlayer, faction: Faction): void export function workForFaction(this: IPlayer, numCycles: number): boolean { const faction = Factions[this.currentWorkFactionName]; - if (!faction) return false + if (!faction) { return false; } //Constantly update the rep gain rate switch (this.factionWorkType) {