From 8e9487838093f73bb5fbcff9ec9b4c8757519c45 Mon Sep 17 00:00:00 2001 From: borisflagell Date: Sat, 21 May 2022 23:18:12 +0200 Subject: [PATCH] WORK: FIX #2721 Singularity faction work logging. fixes #2721 Player's faction-work-related property were reset to 0 before the singularity's log message was formatted. I anticipate (really) minor conflict with Work System rework PR. --- .../Player/PlayerObjectGeneralMethods.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index b44ec6516..399bec8d7 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -993,6 +993,7 @@ export function finishFactionWork(this: IPlayer, cancelled: boolean, sing = fals faction.playerReputation += this.workRepGained; this.updateSkillLevels(); + let res = ""; if (!sing) { dialogBoxCreate( @@ -1013,12 +1014,8 @@ export function finishFactionWork(this: IPlayer, cancelled: boolean, sing = fals
, ); - } - - this.isWorking = false; - this.resetWorkStatus(); - if (sing) { - const res = + } else { + res = "You worked for your faction " + faction.name + " for a total of " + @@ -1039,10 +1036,11 @@ export function finishFactionWork(this: IPlayer, cancelled: boolean, sing = fals " agi exp, and " + numeralWrapper.formatExp(this.workChaExpGained) + " cha exp."; - - return res; } - return ""; + + this.isWorking = false; + this.resetWorkStatus(); + return res; } //Money gained per game cycle