diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 336d72fc13..9f83595e49 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -30,11 +30,20 @@ proc/isDay(var/month, var/day) var/next_duration_update = 0 var/last_round_duration = 0 -proc/round_duration() +var/round_start_time = 0 + +/hook/roundstart/proc/start_timer() + round_start_time = world.time + +#define round_duration_in_ticks (round_start_time ? world.time - round_start_time : 0) + +/proc/round_duration_as_text() + if(!round_start_time) + return "00:00" if(last_round_duration && world.time < next_duration_update) return last_round_duration - var/mills = world.time // 1/10 of a second, not real milliseconds but whatever + var/mills = round_duration_in_ticks // 1/10 of a second, not real milliseconds but whatever //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something var/mins = round((mills % 36000) / 600) var/hours = round(mills / 36000) diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index 597b7f607c..afd1435ffa 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -12,6 +12,6 @@ datum/controller/transfer_controller/Destroy() datum/controller/transfer_controller/proc/process() currenttick = currenttick + 1 - if (world.time >= timerbuffer - 600) + if (round_duration_in_ticks >= timerbuffer - 1 MINUTE) vote.autotransfer() - timerbuffer = timerbuffer + config.vote_autotransfer_interval \ No newline at end of file + timerbuffer = timerbuffer + config.vote_autotransfer_interval diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 83a2f3b370..622be84c3d 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -392,7 +392,7 @@ if (ticker && ticker.current_state >= GAME_STATE_PLAYING) var/dat = "