From ffbd66852bb50dcf066af70d50b9fbc3d7733955 Mon Sep 17 00:00:00 2001 From: Chompstation Bot Date: Fri, 9 Jul 2021 15:54:38 +0000 Subject: [PATCH 1/3] Makes time/tram use REALTIMEOFDAY rather than world.time --- code/_helpers/time.dm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 167af12ab1..2056cb6e6d 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -44,7 +44,7 @@ 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 round_duration_in_ds (GLOB.round_start_time ? world.time - GLOB.round_start_time : 0) +#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() @@ -56,9 +56,17 @@ var/next_station_date_change = 1 DAY next_station_date_change += 1 DAY update_time = TRUE if(!station_date || update_time) +<<<<<<< HEAD var/extra_days = round(station_time_in_ds / (1 DAY)) DAYS var/timeofday = world.timeofday + extra_days station_date = num2text((text2num(time2text(timeofday, "YYYY"))+544)) + "-" + time2text(timeofday, "MM-DD") //YW EDIT +||||||| parent of 590ccf3e0c... Merge pull request #10946 from MarinaGryphon/timedilation-tram + var/extra_days = round(station_time_in_ds / (1 DAY)) DAYS + var/timeofday = world.timeofday + extra_days + station_date = num2text((text2num(time2text(timeofday, "YYYY"))+300)) + "-" + time2text(timeofday, "MM-DD") //VOREStation Edit +======= + station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+300)) + "-" + time2text(REALTIMEOFDAY, "MM-DD") //VOREStation Edit +>>>>>>> 590ccf3e0c... Merge pull request #10946 from MarinaGryphon/timedilation-tram return station_date //ISO 8601 @@ -96,7 +104,7 @@ var/last_round_duration = 0 GLOBAL_VAR_INIT(round_start_time, 0) /hook/roundstart/proc/start_timer() - GLOB.round_start_time = world.time + GLOB.round_start_time = REALTIMEOFDAY return 1 /proc/roundduration2text() @@ -121,7 +129,8 @@ GLOBAL_VAR_INIT(round_start_time, 0) /var/rollovercheck_last_timeofday = 0 /proc/update_midnight_rollover() if (world.timeofday < rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! - return midnight_rollovers++ + midnight_rollovers += 1 + rollovercheck_last_timeofday = world.timeofday return midnight_rollovers //Increases delay as the server gets more overloaded, From 7285e94ef07daed74d83a5f585001248333d7138 Mon Sep 17 00:00:00 2001 From: Nadyr <41974248+Darlantanis@users.noreply.github.com> Date: Sat, 10 Jul 2021 01:25:10 -0400 Subject: [PATCH 2/3] powder that makes you say yes --- code/_helpers/time.dm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 2056cb6e6d..8cbe4ea9dd 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -56,17 +56,7 @@ var/next_station_date_change = 1 DAY next_station_date_change += 1 DAY update_time = TRUE if(!station_date || update_time) -<<<<<<< HEAD - var/extra_days = round(station_time_in_ds / (1 DAY)) DAYS - var/timeofday = world.timeofday + extra_days - station_date = num2text((text2num(time2text(timeofday, "YYYY"))+544)) + "-" + time2text(timeofday, "MM-DD") //YW EDIT -||||||| parent of 590ccf3e0c... Merge pull request #10946 from MarinaGryphon/timedilation-tram - var/extra_days = round(station_time_in_ds / (1 DAY)) DAYS - var/timeofday = world.timeofday + extra_days - station_date = num2text((text2num(time2text(timeofday, "YYYY"))+300)) + "-" + time2text(timeofday, "MM-DD") //VOREStation Edit -======= - station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+300)) + "-" + time2text(REALTIMEOFDAY, "MM-DD") //VOREStation Edit ->>>>>>> 590ccf3e0c... Merge pull request #10946 from MarinaGryphon/timedilation-tram + station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+544)) + "-" + time2text(timeofday, "MM-DD") //CHOMP EDIT return station_date //ISO 8601 From 7476daf3f807221c7409ea427cc24d2cf40bfa70 Mon Sep 17 00:00:00 2001 From: Nadyr <41974248+Darlantanis@users.noreply.github.com> Date: Sat, 10 Jul 2021 01:29:23 -0400 Subject: [PATCH 3/3] powder that makes you say yes --- code/_helpers/time.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 8cbe4ea9dd..df9ce882f5 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -56,7 +56,7 @@ var/next_station_date_change = 1 DAY next_station_date_change += 1 DAY update_time = TRUE if(!station_date || update_time) - station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+544)) + "-" + time2text(timeofday, "MM-DD") //CHOMP EDIT + station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+544)) + "-" + time2text(REALTIMEOFDAY, "MM-DD") //CHOMP EDIT return station_date //ISO 8601