Lawgiver and random fix (#1658)

Fixes an issue that popped up with obj/randoms, they werent getting sucked into lockers

Also fixes that lawgiver runtime.
The issue that previous fixes miss is that DM casts implicitly and without safety checks. Casting an animal to a human does not result in null. an istype check is needed
This commit is contained in:
NanakoAC
2017-01-29 21:16:14 +02:00
committed by skull132
parent 061b946a3a
commit 2cb3bb1a78
3 changed files with 6 additions and 3 deletions
@@ -27,8 +27,9 @@
/obj/structure/closet/initialize()
..()
if(!opened) // if closed, any item at the crate's loc is put in the contents
var/obj/item/I
var/obj/I
for(I in src.loc)
if (!istype(I, /obj/item) && !istype(I, /obj/random))continue
if(I.density || I.anchored || I == src) continue
I.forceMove(src)
// adjust locker size to hold all items with 5 units of free store room