From f5a847464c21b7f1fdd5ad25f4e0e508d44d58c7 Mon Sep 17 00:00:00 2001 From: Casey Date: Sun, 16 Oct 2022 17:08:57 -0400 Subject: [PATCH] Merge pull request #13924 from VOREStation/upstream-merge-8752 [MIRROR] speculative fix for obj/random's not being deleted --- code/game/objects/random/_random.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/game/objects/random/_random.dm b/code/game/objects/random/_random.dm index 460ef4ef4f..3d68245676 100644 --- a/code/game/objects/random/_random.dm +++ b/code/game/objects/random/_random.dm @@ -6,12 +6,14 @@ var/spawn_nothing_percentage = 0 // this variable determines the likelyhood that this random object will not spawn anything var/drop_get_turf = TRUE -// creates a new object and deletes itself + /obj/random/Initialize() + . = INITIALIZE_HINT_QDEL ..() - if(!prob(spawn_nothing_percentage)) - try_spawn_item() - return INITIALIZE_HINT_QDEL + if (prob(spawn_nothing_percentage)) + return + try_spawn_item() + /obj/random/proc/try_spawn_item() var/atom/result = spawn_item()