Round start delay works properly again

This commit is contained in:
SteelSlayer
2019-08-28 19:20:44 -04:00
parent 9cc758f3d7
commit da534b2df1
2 changed files with 12 additions and 3 deletions
+8 -1
View File
@@ -68,8 +68,14 @@ SUBSYSTEM_DEF(ticker)
current_state = GAME_STATE_PREGAME
fire() // TG says this is a good idea
if(GAME_STATE_PREGAME)
if(!going)
return
// This is so we dont have sleeps in controllers, because that is a bad, bad thing
pregame_timeleft = max(0,round_start_time - world.time)
if(!delay_end)
pregame_timeleft = max(0,round_start_time - world.time) // Normal lobby countdown when roundstart was not delayed
else
pregame_timeleft = max(0,pregame_timeleft - 20) // If roundstart was delayed, we should resume the countdown where it left off
if(pregame_timeleft <= 600 && !tipped) // 60 seconds
send_tip_of_the_round()
@@ -83,6 +89,7 @@ SUBSYSTEM_DEF(ticker)
current_state = GAME_STATE_STARTUP
Master.SetRunLevel(RUNLEVEL_LOBBY)
if(GAME_STATE_PLAYING)
delay_end = 0 // reset this in case round start was delayed
mode.process()
mode.process_job_tasks()
var/game_finished = SSshuttle.emergency.mode >= SHUTTLE_ENDGAME || mode.station_was_nuked