Fix detective bag not always showing an item

This commit is contained in:
Markolie
2017-02-10 21:17:32 +01:00
parent dec9bc71ac
commit fb6fee615e
+12 -13
View File
@@ -40,8 +40,7 @@
if(!isturf(I.loc)) //If it isn't on the floor. Do some checks to see if it's in our hands or a box. Otherwise give up.
if(istype(I.loc,/obj/item/weapon/storage)) //in a container.
var/obj/item/weapon/storage/U = I.loc
user.client.screen -= I
U.contents.Remove(I)
U.remove_from_storage(I, src)
else if(user.l_hand == I) //in a hand
user.drop_l_hand()
else if(user.r_hand == I) //in a hand
@@ -59,6 +58,7 @@
I.pixel_x = 0 //then remove it so it'll stay within the evidence bag
I.pixel_y = 0
var/image/img = image("icon"=I, "layer"=FLOAT_LAYER) //take a snapshot. (necessary to stop the underlays appearing under our inventory-HUD slots ~Carn
img.plane = FLOAT_PLANE
I.pixel_x = xx //and then return it
I.pixel_y = yy
overlays += img
@@ -69,7 +69,7 @@
w_class = I.w_class
return 1
/obj/item/weapon/evidencebag/attack_self(mob/user as mob)
/obj/item/weapon/evidencebag/attack_self(mob/user)
if(contents.len)
var/obj/item/I = contents[1]
user.visible_message("<span class='notice'>[user] takes [I] out of [src].</span>", "<span class='notice'>You take [I] out of [src].</span>",\
@@ -83,17 +83,16 @@
else
to_chat(user, "[src] is empty.")
icon_state = "evidenceobj"
return
/obj/item/weapon/storage/box/evidence
name = "evidence bag box"
desc = "A box claiming to contain evidence bags."
New()
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
..()
return
/obj/item/weapon/storage/box/evidence/New()
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
new /obj/item/weapon/evidencebag(src)
..()