obj
var
Cdef
cloths
icon='Clothes.dmi'
layer=MOB_LAYER + 1
Blue
name="Blue Robe"
icon_state="Blue"
Cdef=10
Green
name="Green Robe"
icon_state="Green"
Cdef=25
Click()
if(suffix=="Equipped")
suffix=null
usr.overlays-=type
usr<<"You unequip [src]."
usr.def-=src.Cdef
else
for(var/obj/cloths/O in usr)
if(O.suffix=="Equipped")
O.suffix=null
usr.overlays-=O.type
usr<<"You unequip [O]."
suffix="Equipped"
usr.overlays+=type
usr.def+=src.Cdef
Problem description:
Well,... Let me try to explain the bug. it works fine by clicking the robe and getting the def, then clicking again and losing the def. But if you have BOTH robes, click(equip) one and then click the other one without unequipting the first one you dont lose the def of the first one. Example: You have 50def, you equiped the blue one and get 10def added on, then equiped the green one and get 25def added on, then again click the blue one and get ANOTHER 10 def added on, repeat and get 1000def in a minute...
Question: How would I fix this o.o
There ya go, look at the line I commented...
-KirbyAllStar