From 791ae389d8f597e409f82b80ba143c6a2e8a156b Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Sat, 13 Sep 2025 23:50:00 -0700 Subject: [PATCH] fix: correct Activation/Expiry date for Ghoul Emergence (#2777) Closes #2775 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2777 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> --- src/services/worldStateService.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index e970496d..9667340d 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -2803,7 +2803,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => { const activeStartDay = day - ghoulsCycleDay + 17; const activeEndDay = activeStartDay + 5; - const dayWithFraction = (timeMs - EPOCH) / 86400000; + const dayWithFraction = (timeMs - EPOCH) / unixTimesInMs.day; const progress = (dayWithFraction - activeStartDay) / (activeEndDay - activeStartDay); const healthPct = 1 - Math.min(Math.max(progress, 0), 1); @@ -2814,22 +2814,14 @@ export const getWorldState = (buildLabel?: string): IWorldState => { $date: { $numberLong: config.worldState?.ghoulEmergenceOverride ? "1753204900185" - : Date.UTC( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate() + activeStartDay - ).toString() + : (EPOCH + activeStartDay * unixTimesInMs.day).toString() } }, Expiry: { $date: { $numberLong: config.worldState?.ghoulEmergenceOverride ? "2000000000000" - : Date.UTC( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate() + activeEndDay - ).toString() + : (EPOCH + activeEndDay * unixTimesInMs.day).toString() } }, HealthPct: config.worldState?.ghoulEmergenceOverride ? 1 : healthPct,