obj/var/equip
obj/clothing/var/been_dblclicked
obj
clothing
icon = 'clothing.dmi'
var
clothing_defense = 0 // instantiate the type as a number
clothing_strength = 0
obj
clothing
proc
Equip()
if(src.equip) //if it's not on, add it
src.layer = CLOTHING_LAYER // the layer for all clothes
usr.overlays += src
usr.added_on_defense += src.clothing_defense
src.suffix = " equip"
return
if(!src.equip) //if it's on, take it off
usr.added_on_defense -= src.clothing_defense
src.suffix = ""
usr.overlays -= src
return
DblClick()
set src in usr.contents
if(been_dblclicked)
been_dblclicked = 0
src.equip = 0
Equip()
return
else
been_dblclicked = 1
src.equip = 1
Equip()
return
Problem description:Well I really didn't want to ask this because I wanted to figure this out by myself but since I've already put like a few hours of troubleshooting into this I'll ask here anyways.
The problem is that once the overlay is added, if you DblClick again in your contents on the item so that equip now equals 0, everything BUT the removing of the overlay works under the if(!src.equip) statement. That's good but I want the overlay to be removed and it's not working.