From 50dcb9f85a2cd950caff3513052c012cfacc43a6 Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Sat, 9 Sep 2023 17:54:27 +0100 Subject: [PATCH] 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: --- 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()