From fc0d29b95653a22806535a72f4c02a4842bb18ba Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Fri, 31 Mar 2017 22:17:03 +0100 Subject: [PATCH 1/2] Minor changes to some time procs - Lets you pass any value to gameTimestamp, allowing you to work out what IC time it would be in (world.time + 3000). - Puts the gametime_offset (currently 12 hours) in ticker, so it's not just a fucking magic number in a function. This would allow us, at a later date, to have the starting station time randomised to be something other than 12:00. --- code/__HELPERS/time.dm | 8 +++++--- code/controllers/subsystem/ticker.dm | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index a7921a48bbb..aaa9e08e5c0 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -1,13 +1,15 @@ //Returns the world time in english /proc/worldtime2text() - return gameTimestamp("hh:mm:ss") + return gameTimestamp("hh:mm:ss", wtime=world.time) /proc/time_stamp(format = "hh:mm:ss", show_ds) var/time_string = time2text(world.timeofday, format) return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string -/proc/gameTimestamp(format = "hh:mm:ss") // Get the game time in text - return time2text(world.time - timezoneOffset + 432000 - round_start_time, format) +/proc/gameTimestamp(format = "hh:mm:ss", wtime=null) + if(!wtime) + wtime = world.time + return time2text(wtime - timezoneOffset + ticker.gametime_offset - round_start_time, format) /* Returns 1 if it is the selected month and day */ /proc/isDay(month, day) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 7aafb8c3ebb..54887e5cefd 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -44,6 +44,8 @@ var/datum/controller/subsystem/ticker/ticker var/timeLeft //pregame timer var/start_at + var/gametime_offset = 432000 // equal to 12 hours, making gametime at roundstart 12:00:00 + var/totalPlayers = 0 //used for pregame stats on statpanel var/totalPlayersReady = 0 //used for pregame stats on statpanel From e31f7ba6ba95543df97cbefd0928fdb360a67f92 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Fri, 31 Mar 2017 22:30:33 +0100 Subject: [PATCH 2/2] RR I --- 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 aaa9e08e5c0..2c3c85b002f 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -1,6 +1,6 @@ //Returns the world time in english /proc/worldtime2text() - return gameTimestamp("hh:mm:ss", wtime=world.time) + return gameTimestamp("hh:mm:ss", world.time) /proc/time_stamp(format = "hh:mm:ss", show_ds) var/time_string = time2text(world.timeofday, format)