mob/var/list
equipment = list("Hair" = null, "Headgear" = null,"Head" = null,
"Shirt" = null, "Torso" = null,
"Right Hand" = null, "Left Hand" = null,
"Pants" = null, "Legs" = null, "Feet" = null,
"Accessory 1" = null, "Accessory 2" = null)
Equipment
parent_type = /obj
var
stored_appearance = null
slot_type = ""
equipped = null
show_icon = 1
level_requirement = 0
proc
Equip(mob/m, Equipment/item)
var/slot, list/equipment = m.equipment
if((slot = item.equipped)) //unequip branch
equipment[slot] = null
item.equipped = null
m.overlays -= item.stored_appearance
item.stored_appearance = null
item.overlays -= 'Equipped.dmi'
else
slot = item.slot_type
var/len = length(slot), Equipment/found, slotname
if(text2ascii(slot,len) == 35) //if slot ends in "#"
slot = copytext(slot, 1, len)
var/count = 1
while( (slotname = "[slot][count]") in equipment)
++count
if(!(found = equipment[slotname]))
slot = slotname
slotname = null
break
if(slotname&&count>1)
slot = "[slot][count-1]"
found = equipment[slot]
slotname = null
else if(slotname &&count==1)
return
else
found = equipment[slot]
if(found)
equipment[slot] = null
found.equipped = null
m.overlays -= found.stored_appearance
found.stored_appearance = null
item.overlays -= 'Equipped.dmi'
equipment[slot] = item
item.equipped = slot
m.overlays += (item.stored_appearance = item.appearance)
item.overlays += 'Equipped.dmi'
m.equipment = equipment
m.update_stats()
Problem description:
Everything works up to an extent, there are no issues until the user relogs or logs out or logs in (Only tested on the local-client). You can remove and add the equipment to the overlays but, if you relog once its equipped.You are incapable of removing the overlays from the user, I do not understand why this is the case and have confronted it on the BYOND Discord chat several times. If anyone could shed some light, I'll appreciate it.