Fixes round time being miscounted

It is now based on when the round actually started, rather than when the
world was first loaded.
This commit is contained in:
Krausus
2016-07-04 15:38:16 -04:00
parent 0706e619ba
commit 80ffe80530
4 changed files with 6 additions and 3 deletions
+3
View File
@@ -256,3 +256,6 @@
#define TRIGGER_GUARD_ALLOW_ALL -1
#define TRIGGER_GUARD_NONE 0
#define TRIGGER_GUARD_NORMAL 1
// Macro to get the current elapsed round time, rather than total world runtime
#define ROUND_TIME (round_start_time ? (world.time - round_start_time) : 0)
+1 -1
View File
@@ -23,7 +23,7 @@
return wtime + (time_offset + wusage) * world.tick_lag
//Returns the world time in english
/proc/worldtime2text(time = world.time)
/proc/worldtime2text(time = ROUND_TIME)
return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"
/proc/time_stamp()
+1 -1
View File
@@ -435,7 +435,7 @@ var/round_start_time = 0
end_state.count()
var/station_integrity = min(round( 100.0 * start_state.score(end_state), 0.1), 100.0)
to_chat(world, "<BR>[TAB]Shift Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B>")
to_chat(world, "<BR>[TAB]Shift Duration: <B>[round(ROUND_TIME / 36000)]:[add_zero("[ROUND_TIME / 600 % 60]", 2)]:[ROUND_TIME / 100 % 6][ROUND_TIME / 100 % 10]</B>")
to_chat(world, "<BR>[TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
to_chat(world, "<BR>")
+1 -1
View File
@@ -409,7 +409,7 @@
if (ticker && ticker.current_state >= GAME_STATE_PLAYING)
var/dat = "<html><head><title>Round Status</title></head><body><h1><B>Round Status</B></h1>"
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero(num2text(world.time / 600 % 60), 2)]:[add_zero(num2text(world.time / 10 % 60), 2)]</B><BR>"
dat += "Round Duration: <B>[round(ROUND_TIME / 36000)]:[add_zero(num2text(ROUND_TIME / 600 % 60), 2)]:[add_zero(num2text(ROUND_TIME / 10 % 60), 2)]</B><BR>"
dat += "<B>Emergency shuttle</B><BR>"
if(shuttle_master.emergency.mode < SHUTTLE_CALL)
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"