Better random plush spawning (#11792)
* better spawning * check list size * changes
This commit is contained in:
@@ -434,7 +434,15 @@ GLOBAL_LIST_INIT(valid_plushie_paths, valid_plushie_paths())
|
||||
can_random_spawn = FALSE
|
||||
|
||||
/obj/item/toy/plush/random/Initialize()
|
||||
var/newtype = prob(CONFIG_GET(number/snowflake_plushie_prob))? /obj/item/toy/plush/random_snowflake : pick(GLOB.valid_plushie_paths)
|
||||
var/newtype
|
||||
var/list/snowflake_list = CONFIG_GET(keyed_list/snowflake_plushies)
|
||||
|
||||
/// If there are no snowflake plushies we'll default to base plush, so we grab from the valid list
|
||||
if (snowflake_list.len)
|
||||
newtype = prob(CONFIG_GET(number/snowflake_plushie_prob)) ? /obj/item/toy/plush/random_snowflake : pick(GLOB.valid_plushie_paths)
|
||||
else
|
||||
newtype = pick(GLOB.valid_plushie_paths)
|
||||
|
||||
new newtype(loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user