ID:262758
 
Code:
    armor
var/def
var/state
equip(mob/M)
if(equipped)
M.armor-=src.def
M.overlays-=src
src.layer=OBJ_LAYER
src.icon_state="[state]"
else
M.armor+=src.def
src.icon_state="[state]_worn"
src.layer=MOB_LAYER+2
M.overlays+=src
..() //parent proc switches equippped (equipped=!equipped)


Problem description:
The overlay doesn't get removed. I never can get this stuff to work.
Well, you're already on the wrong track with the equipped var. Equipment should never have a var like that. Equipped status should be kept track of by the mob.

Lummox JR
In response to Lummox JR
I actually tried removing it just now but relized that I need it for my drop verb (it checks if it's equipped and unequips it if it is)

But I am adding equipment variables for the player mob.
In response to Dark Weasel
Dark Weasel wrote:
I actually tried removing it just now but relized that I need it for my drop verb (it checks if it's equipped and unequips it if it is)

No, you never need that var. If the mob knows what you have equipped, you can compare that to the item you're dropping.

Lummox JR
In response to Lummox JR
To further expand on what Lummox is saying, the route you should take is to give the mobs an "equipped" list, and add/remove items from it as they equip/unequip them...

Basically, any time where you would have been checking "if(item.equipped)", you could then check "if(item in player.equipped)" (or something of the sort)

If you use variables, you'll end up with a huge list of them, and will have to be checking them all every time you check if an item is equipped or not... A list would keep it simple, and intuitive...
In response to SuperSaiyanGokuX
Okay, but this still doesn't help with my original problem.
In response to Dark Weasel
Dark Weasel wrote:
Okay, but this still doesn't help with my original problem.

If you have termites in your house, you wouldn't repair a damaged wall without getting rid of the termites first, would you?