Merging changes from /tg

https://github.com/tgstation/tgstation/pull/29637 Fixes subsystem MC crash tracking
https://github.com/tgstation/tgstation/pull/30092 Subsystem PreInit() now respects init_order
This commit is contained in:
Leshana
2017-12-27 18:58:51 -05:00
parent 2024cc3fac
commit 032d26010b
3 changed files with 10 additions and 5 deletions

View File

@@ -54,13 +54,17 @@ var/datum/controller/master/Master = new()
/datum/controller/master/New()
// Highlander-style: there can only be one! Kill off the old and replace it with the new.
subsystems = list()
var/list/_subsystems = list()
subsystems = _subsystems
if (Master != src)
if (istype(Master))
Recover()
qdel(Master)
else
init_subtypes(/datum/controller/subsystem, subsystems)
var/list/subsytem_types = subtypesof(/datum/controller/subsystem)
sortTim(subsytem_types, /proc/cmp_subsystem_init)
for(var/I in subsytem_types)
_subsystems += new I
Master = src
/datum/controller/master/Destroy()
@@ -114,7 +118,8 @@ var/datum/controller/master/Master = new()
var/FireHim = FALSE
if(istype(BadBoy))
msg = null
switch(++BadBoy.failure_strikes)
LAZYINITLIST(BadBoy.failure_strikes)
switch(++BadBoy.failure_strikes[BadBoy.type])
if(2)
msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again."
FireHim = TRUE