diff --git a/code/datums/elements/ridable.dm b/code/datums/elements/ridable.dm index 9844c1d2258..e2c9544b427 100644 --- a/code/datums/elements/ridable.dm +++ b/code/datums/elements/ridable.dm @@ -8,7 +8,7 @@ */ /datum/element/ridable element_flags = ELEMENT_BESPOKE - + id_arg_index = 2 /// The specific riding component subtype we're loading our instructions from, don't leave this as default please! var/riding_component_type = /datum/component/riding /// If we have a xenobio red potion applied to us, we get split off so we can pass our special status onto new riding components diff --git a/code/datums/elements/shatters_when_thrown.dm b/code/datums/elements/shatters_when_thrown.dm index d8e3aec4273..20e2ddbfb43 100644 --- a/code/datums/elements/shatters_when_thrown.dm +++ b/code/datums/elements/shatters_when_thrown.dm @@ -3,7 +3,7 @@ */ /datum/element/shatters_when_thrown element_flags = ELEMENT_BESPOKE - + id_arg_index = 2 /// What type of item is spawned as a 'shard' once the shattering happens var/obj/item/shard_type /// How many shards total are made when the thing we're attached to shatters diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index cbaa4b3043f..400eae48171 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -11,6 +11,7 @@ #include "component_tests.dm" #include "config_sanity.dm" #include "crafting_lists.dm" +#include "element_tests.dm" #include "emotes.dm" #include "init_sanity.dm" #include "log_format.dm" diff --git a/code/modules/unit_tests/element_tests.dm b/code/modules/unit_tests/element_tests.dm new file mode 100644 index 00000000000..77c6370ec31 --- /dev/null +++ b/code/modules/unit_tests/element_tests.dm @@ -0,0 +1,4 @@ +/datum/unit_test/bespoke_element/Run() + for(var/datum/element/element_type as anything in subtypesof(/datum/element)) + if(initial(element_type.element_flags) & ELEMENT_BESPOKE && initial(element_type.id_arg_index) == INFINITY) + Fail("Element type [element_type] has ELEMENT_BESPOKE and a default id_arg_index.")