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>
This commit is contained in:
kyunkyunkyun
2024-09-29 14:52:38 +05:00
committed by GitHub
parent c6f9a5ea9c
commit 882b1e4a0b
+7 -1
View File
@@ -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)