From 882b1e4a0b3ba8a9d5b0a4e4352c75c9398c14a3 Mon Sep 17 00:00:00 2001 From: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:52:38 +0500 Subject: [PATCH] Fixes safe being unable to pick up spawner/random/ (#26891) * Safe fixing * Update code/game/objects/structures/safe.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com> --------- Signed-off-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/game/objects/structures/safe.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 9690527151d4..fa06f02f4fd8 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -71,10 +71,16 @@ GLOBAL_LIST_EMPTY(safes) // Combination generation for(var/i in 1 to number_of_tumblers) tumblers.Add(rand(0, 99)) + if(mapload) + addtimer(CALLBACK(src, PROC_REF(take_contents)), 0) + +/obj/structure/safe/proc/take_contents() // Put as many items on our turf inside as possible for(var/obj/item/I in loc) + if(I.density || I.anchored) + continue if(space >= maxspace) - return + break if(I.w_class + space <= maxspace) space += I.w_class I.forceMove(src)