Merge pull request #13924 from VOREStation/upstream-merge-8752

[MIRROR] speculative fix for obj/random's not being deleted
This commit is contained in:
Casey
2022-10-16 21:10:01 +00:00
committed by CHOMPStation2
parent e2d375214d
commit f5a847464c
+6 -4
View File
@@ -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()