fix: correct Activation/Expiry date for Ghoul Emergence
All checks were successful
Build / build (pull_request) Successful in 1m12s

Closes #2775
This commit is contained in:
AMelonInsideLemon 2025-09-13 19:35:41 +02:00
parent d027e7f26e
commit 167fd84cd4

View File

@ -2803,7 +2803,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
const activeStartDay = day - ghoulsCycleDay + 17; const activeStartDay = day - ghoulsCycleDay + 17;
const activeEndDay = activeStartDay + 5; const activeEndDay = activeStartDay + 5;
const dayWithFraction = (timeMs - EPOCH) / 86400000; const dayWithFraction = (timeMs - EPOCH) / unixTimesInMs.day;
const progress = (dayWithFraction - activeStartDay) / (activeEndDay - activeStartDay); const progress = (dayWithFraction - activeStartDay) / (activeEndDay - activeStartDay);
const healthPct = 1 - Math.min(Math.max(progress, 0), 1); const healthPct = 1 - Math.min(Math.max(progress, 0), 1);
@ -2814,22 +2814,14 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
$date: { $date: {
$numberLong: config.worldState?.ghoulEmergenceOverride $numberLong: config.worldState?.ghoulEmergenceOverride
? "1753204900185" ? "1753204900185"
: Date.UTC( : (EPOCH + activeStartDay * unixTimesInMs.day).toString()
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate() + activeStartDay
).toString()
} }
}, },
Expiry: { Expiry: {
$date: { $date: {
$numberLong: config.worldState?.ghoulEmergenceOverride $numberLong: config.worldState?.ghoulEmergenceOverride
? "2000000000000" ? "2000000000000"
: Date.UTC( : (EPOCH + activeEndDay * unixTimesInMs.day).toString()
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate() + activeEndDay
).toString()
} }
}, },
HealthPct: config.worldState?.ghoulEmergenceOverride ? 1 : healthPct, HealthPct: config.worldState?.ghoulEmergenceOverride ? 1 : healthPct,