obj/Warrior/Helms
icon='Warrior Helms.dmi'
Ascalon_Helm
icon_state="Ascalon"
density=0
layer=MOB_LAYER+1
verb
Get()
set src in oview(1)
set category = "Commands"
Move(usr)
view()<<"[usr] got the [src]!"
Drop()
view()<<"[usr] dropped the [src]!"
src.loc=locate(usr.x,usr.y,usr.z)
if(usr.EHelm==1)
usr.EHelm=0
else
return
Equip()
if(usr.Warrior==1)
if(usr.EHelm==0)
usr<<"You equipped the [src]!"
suffix="E"
usr.overlays += /obj/Warrior/Helms/Ascalon_Helm
usr.EHelm=1
return
if(usr.EHelm==1)
usr<<"You have something equipped in this spot!"
return
else
usr<<"You can't use this since your not a warrior!"
Unequip()
if(usr.EHelm==1)
usr<<"You unequipped the [src]!"
suffix=""
usr.overlays -= /obj/Warrior/Helms/Ascalon_Helm
usr.EHelm=0
return
if(usr.EHelm==0)
usr<<"There is nothing equipped here."
Problem description:
When I test this in the game for ANY item I press the button to unequip the item, the Overlay of the item will stay there if I logged out with the overlay on. But if i didnt log out with the overlay on, it will remove it just fine. How would I fix this?
To avoid this, you need to keep track of which items the player has equipped, then un-equip those items before the save and re-equip them afterwards, and also when the savefile is loaded.
Its also good to put the "You equipped..." text message in a separate function somewhere so players don't get spammed with messages when this happens.