mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 10:35:41 +01:00
Adds a unit test that makes sure subsystem flags make sense (#96022)
## About The Pull Request There's a few of these that conflict, mostly relating to timing. This conflicting won't actually break anything but it does muddy "what is this doing" somewhat and it's good to be clear so here we go ## Why It's Good For The Game Makes the MC very slightly harder to confuse yourself with
This commit is contained in:
@@ -327,6 +327,7 @@
|
||||
#include "strippable.dm"
|
||||
#include "stuns.dm"
|
||||
#include "style_hotswapping.dm"
|
||||
#include "subsystem_flags.dm"
|
||||
#include "subsystem_init.dm"
|
||||
#include "suit_sensor.dm"
|
||||
#include "suit_storage_icons.dm"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Ensures subystem flags are set in a coherent way
|
||||
/datum/unit_test/subsystem_flags
|
||||
|
||||
/datum/unit_test/subsystem_flags/Run()
|
||||
for(var/datum/controller/subsystem/sub_lad as anything in subtypesof(/datum/controller/subsystem))
|
||||
if((sub_lad::ss_flags & (SS_TICKER | SS_KEEP_TIMING)) == (SS_TICKER | SS_KEEP_TIMING))
|
||||
var/list/matching = get_matching_bitflags("ss_flags", sub_lad::ss_flags)
|
||||
TEST_FAIL("[sub_lad] {[matching.Join(" | ")]} had both SS_TICKER and SEE_KEEP_TIMING set, this is redundant! You should likely remove SS_KEEP_TIMING.")
|
||||
if((sub_lad::ss_flags & (SS_POST_FIRE_TIMING | SS_KEEP_TIMING)) == (SS_POST_FIRE_TIMING | SS_KEEP_TIMING))
|
||||
var/list/matching = get_matching_bitflags("ss_flags", sub_lad::ss_flags)
|
||||
TEST_FAIL("[sub_lad] {[matching.Join(" | ")]} had both SS_POST_FIRE_TIMING and SEE_KEEP_TIMING set, this is redundant! You should likely remove SS_KEEP_TIMING as SS_POST_FIRE_TIMING overrides it.")
|
||||
|
||||
Reference in New Issue
Block a user