Skip to content

Commit

Permalink
Fixes clown faction runtimes. (tgstation#67707)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnturK authored Jun 13, 2022
1 parent e6ad4ca commit b640669
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
unsuitable_atmos_damage = 10
unsuitable_heat_damage = 15
footstep_type = FOOTSTEP_MOB_SHOE
faction = FACTION_CLOWN
faction = list(FACTION_CLOWN)
var/attack_reagent

/mob/living/simple_animal/hostile/retaliate/clown/Initialize(mapload)
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
#include "medical_wounds.dm"
#include "merge_type.dm"
#include "metabolizing.dm"
#include "mob_faction.dm"
#include "mob_spawn.dm"
#include "modsuit.dm"
#include "modular_map_loader.dm"
Expand Down
19 changes: 19 additions & 0 deletions code/modules/unit_tests/mob_faction.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// Checks if any mob's faction var initial value is not a list, which is not supported by the current code
/datum/unit_test/mob_faction

/datum/unit_test/mob_faction/Run()
/// Right now taken from create_and_destroy
var/list/ignored = list(
/mob/living/carbon,
/mob/dview,
/mob/oranges_ear
)
ignored += typesof(/mob/camera/imaginary_friend)
ignored += typesof(/mob/living/simple_animal/pet/gondola/gondolapod)
ignored += typesof(/mob/living/silicon/robot/model)
ignored += typesof(/mob/camera/ai_eye/remote/base_construction)
ignored += typesof(/mob/camera/ai_eye/remote/shuttle_docker)
for (var/mob_type in typesof(/mob) - ignored)
var/mob/mob_instance = allocate(mob_type)
if(!islist(mob_instance.faction))
TEST_FAIL("[mob_type] faction variable is not a list")

0 comments on commit b640669

Please sign in to comment.