From e6313f6ae8e3563c9c586100d12f023de09fa6f8 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 14 Nov 2021 00:13:02 -0500 Subject: [PATCH] Merge pull request #11793 from Heroman3003/timefix2 Reworks timestamps of specific time using wrong time compared to station time --- code/_helpers/time.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index d63d263801..863354a46c 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -50,13 +50,17 @@ var/station_date = "" var/next_station_date_change = 1 DAY #define duration2stationtime(time) time2text(station_time_in_ds + time, "hh:mm") -#define worldtime2stationtime(time) time2text(GLOB.roundstart_hour HOURS + time, "hh:mm") +#define roundstart_delay_time (world.time - round_duration_in_ds) +#define world_time_in_ds(time) (GLOB.roundstart_hour HOURS + time - roundstart_delay_time) #define round_duration_in_ds (GLOB.round_start_time ? REALTIMEOFDAY - GLOB.round_start_time : 0) #define station_time_in_ds (GLOB.roundstart_hour HOURS + round_duration_in_ds) /proc/stationtime2text() return time2text(station_time_in_ds + GLOB.timezoneOffset, "hh:mm") +/proc/worldtime2stationtime(time) + return time2text(world_time_in_ds(time) + GLOB.timezoneOffset, "hh:mm") + /proc/stationdate2text() var/update_time = FALSE if(station_time_in_ds > next_station_date_change)