mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Makes time/tram use REALTIMEOFDAY rather than world.time
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user