From c358ff3f6f43075ca38f9fb62e03d721e07dc5aa Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 9 Sep 2023 22:55:12 +0200 Subject: [PATCH] [MIRROR] Allow spawner component to be instantiated with an empty list [MDB IGNORE] (#23598) * Allow spawner component to be instantiated with an empty list (#78188) ## About The Pull Request Supplementary to ffd3edc22b9c649e7ae8e229d5050d1d9490dfa8 Fixes #78172 The spawner component could be added to arbitrary items by admins but would always throw an error because it was passed an empty list. Admins were not capable of providing anything _other_ than an empty list to it on init, due to limitations in our interface. We (I but I had help) broke this in #73645 by removing the default "spawns carp" list. It is still silly for it to default to spawning carp, but instead it can now be instantiated with an empty list without breaking, and an admin can then VV it to further modify the list to what they actually want it to do. ## Changelog :cl: admin: Admins can add/remove the spawner component from arbitrary items again. /:cl: * Allow spawner component to be instantiated with an empty list --------- Co-authored-by: Jacquerel --- code/datums/components/spawner.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/datums/components/spawner.dm b/code/datums/components/spawner.dm index abb93154099..3f660d5fcbd 100644 --- a/code/datums/components/spawner.dm +++ b/code/datums/components/spawner.dm @@ -38,6 +38,8 @@ /// Try to create a new mob /datum/component/spawner/proc/try_spawn_mob() + if(!length(spawn_types)) + return if(!COOLDOWN_FINISHED(src, spawn_delay)) return validate_references()