mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Small MC refactor (#20017)
* Small MC refactor * Order fix * Nabs tgstation/tgstation#27324 * Oops * gnarg
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
/datum/unit_test/subsystem_init/Run()
|
||||
for(var/i in Master.subsystems)
|
||||
var/datum/controller/subsystem/ss = i
|
||||
if(ss.flags & SS_NO_INIT)
|
||||
continue
|
||||
if(!ss.initialized)
|
||||
Fail("[ss]([ss.type]) is a subsystem meant to initialize but doesn't get set as initialized.")
|
||||
var/datum/controller/subsystem/base_ss
|
||||
var/default_offline_implications = initial(base_ss.offline_implications)
|
||||
for(var/datum/controller/subsystem/SS as anything in Master.subsystems)
|
||||
if((SS.flags & SS_NO_INIT) && (SS.flags & SS_NO_FIRE))
|
||||
Fail("[SS]([SS.type]) is a subsystem which is set to not initialize or fire. Use a global datum instead an SS.")
|
||||
|
||||
if(!(SS.flags & SS_NO_FIRE) && SS.offline_implications == default_offline_implications)
|
||||
Fail("[SS]([SS.type]) is a subsystem which fires but has no offline implications set.")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/unit_test/subsystem_metric_sanity/Run()
|
||||
for(var/datum/controller/subsystem/SS in Master.subsystems)
|
||||
var/list/data = SS.get_metrics()
|
||||
if(length(data) != 3)
|
||||
if(length(data) != 4)
|
||||
Fail("SS[SS.ss_id] has invalid metrics data!")
|
||||
continue
|
||||
if(isnull(data["cost"]))
|
||||
@@ -17,3 +17,6 @@
|
||||
if(!islist(data["custom"]))
|
||||
Fail("SS[SS.ss_id] has invalid metrics data! 'custom' is not a list in [json_encode(data)]")
|
||||
continue
|
||||
if(isnull(data["sleep_count"]))
|
||||
Fail("SS[SS.ss_id] has invalid metrics data! No 'sleep_count' found in [json_encode(data)]")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user