From c8e5abc937b630bb91532534fa2ae6030df66acc Mon Sep 17 00:00:00 2001 From: Atermonera Date: Fri, 15 May 2020 13:34:31 -0700 Subject: [PATCH] Random item spawners qdel properly on init without using sleep (#7134) --- code/game/objects/random/_random.dm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/code/game/objects/random/_random.dm b/code/game/objects/random/_random.dm index b559495eb5..8b616c83f5 100644 --- a/code/game/objects/random/_random.dm +++ b/code/game/objects/random/_random.dm @@ -11,15 +11,7 @@ . = ..() if (!prob(spawn_nothing_percentage)) spawn_item() - Random_SafeDestroy(0) - -// This function should, theoretically, guarantee the deletion of the random object. Not all of them destroy themselves for some reason, especially if created through non-standard means. -/obj/random/proc/Random_SafeDestroy(var/recursion_level) - set waitfor = FALSE - sleep(30) - qdel(src) - if(src && recursion_level < 5) - Random_SafeDestroy(recursion_level + 1) + return INITIALIZE_HINT_QDEL // this function should return a specific item to spawn /obj/random/proc/item_to_spawn()