From 664e99e3deaca99c8d5cebf766e628c68f4b7235 Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Robinson" Date: Tue, 11 Jan 2022 21:08:15 -0800 Subject: [PATCH] Ensure that we leave focus when we call stopAction or cancel working --- src/NetscriptFunctions/Singularity.ts | 1 + src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 64fc34497..34f154f8f 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -738,6 +738,7 @@ export function NetscriptSingularity( helper.checkSingularityAccess("stopAction"); if (player.isWorking) { if (player.focus) { + player.stopFocusing(); Router.toTerminal(); } const txt = player.singularityStopWork(); diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index 3991047d7..9a44d64ad 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -729,6 +729,7 @@ export function finishWork(this: IPlayer, cancelled: boolean, sing = false): str } this.isWorking = false; + this.focus = false; this.resetWorkStatus(); if (sing) {