This is just a simple peice of code that any other BYOND 'rpg' has, picking up equipping blah blah. Well in the overlays i used an image (Maz had sudgested) so i did. It was working fine until i had set the image's layer to something, then it just plain wouldn't remove. Any help on fixing this?
obj/Armor/Shield
Click()
if(get_dist(usr,src)<=1)
if(usr.Inventory<=5)
usr.Inventory++
Move(usr)
DblClick()
if(src.loc==usr)
if(src.suffix=="Equipped")
src.suffix=null
var/image/I=image(src.icon,src.icon_state)
for(I in usr.overlays)
usr.overlays-=I
else
for(var/obj/Armor/Shield/A in usr)
A.suffix=null
src.suffix="Equipped"
var/image/I=image(src.icon,"[src.icon_state]")
I.layer=99
usr.overlays+=I
The overlays list is weird. You can overlays.Cut() or something similar to remove all of the items in it, though.