mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
adds a unique species id unit test + cleans up some golem mischief (#66050)
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
#include "spawn_humans.dm"
|
||||
#include "spawn_mobs.dm"
|
||||
#include "species_config_sanity.dm"
|
||||
#include "species_unique_id.dm"
|
||||
#include "species_whitelists.dm"
|
||||
#include "stomach.dm"
|
||||
#include "strippable.dm"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Every species should use a species ID unique to it and it alone. This test runs through every subtype of /datum/species, and checks for a species ID.
|
||||
* Every ID is written to a list, gathered_species_ids, and if a previously written ID is written again, this test will fail.
|
||||
*/
|
||||
/datum/unit_test/species_unique_id
|
||||
|
||||
/datum/unit_test/species_unique_id/Run()
|
||||
var/list/gathered_species_ids = list()
|
||||
for(var/datum/species/species as anything in subtypesof(/datum/species))
|
||||
var/species_id = initial(species.id)
|
||||
if(gathered_species_ids[species_id])
|
||||
Fail("Duplicate species ID! [species_id] is not unique to a single species.")
|
||||
else
|
||||
gathered_species_ids[species_id] = TRUE
|
||||
Reference in New Issue
Block a user