Roundstart Events. Fixes xeno egg announcement timer (#25659)

* Add support for roundstart events

* Fixes #25649
This commit is contained in:
Cyberboss
2017-03-31 14:20:40 -04:00
committed by AnturK
parent 7ad5a718aa
commit e3c31d2fa7
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -58,6 +58,8 @@ var/datum/controller/subsystem/ticker/ticker
var/late_join_disabled
var/list/round_start_events
/datum/controller/subsystem/ticker/New()
NEW_SS_GLOBAL(ticker)
@@ -202,6 +204,11 @@ var/datum/controller/subsystem/ticker/ticker
transfer_characters() //transfer keys to the new mobs
Master.RoundStart() //let the party begin...
for(var/I in round_start_events)
var/datum/callback/cb = I
cb.InvokeAsync()
LAZYCLEARLIST(round_start_events)
log_world("Game start took [(world.timeofday - init_start)/10]s")
round_start_time = world.time
@@ -234,6 +241,12 @@ var/datum/controller/subsystem/ticker/ticker
var/list/allmins = adm["present"]
send2irc("Server", "Round of [hide_mode ? "secret":"[mode.name]"] has started[allmins.len ? ".":" with no active admins online!"]")
/datum/controller/subsystem/ticker/proc/OnRoundstart(datum/callback/cb)
if(current_state < GAME_STATE_PLAYING)
LAZYADD(round_start_events, cb)
else
cb.InvokeAsync()
/datum/controller/subsystem/ticker/proc/station_explosion_detonation(atom/bomb)
if(bomb) //BOOM
var/turf/epi = bomb.loc