ID:261836
 
        var/list/hairs = list("Parted", "Bearded", "Bushie", "Ceasar", "Mid-Aged", "Red-Bush", "Dwarfish") in Hair
help_text = "((Select a hair-style that best fits your character.))"
default_value = "Parted"
var/hair_style = input(src, help_text, prompt_title, default_value) in hairs
switch(hair_style)
if ("Parted")
new_mob.Hair = icon('Head.dmi', "1")
usr.icoHair = Hair
Refresh_Overlays()


------------

/mob/proc/Refresh_Overlays()
overlays = null
overlays += icoArms
overlays += icoChest
overlays += icoShoulders
overlays += icoLegs
overlays += icoHands
overlays += icoBack
if (icoHead != null)
overlays += icoHead
else
overlays += icoHair
overlays += icoWeapon



Now, the problem is. When I equip my sword, it uses the Refresh_Overlays() procedure, and then it doesn't re-add my head or somethin, but when I equip a weapon, it deletes the user's head. Any explenations how I should go about fixing this?

Thanks in advance! With <3~
Is the hair showing up? Are you setting icoHead to anything; and if so, can you show that segment of code?
In response to Crispy
        Head
Leather_Cap
name = "Leather"
icon = 'Head.dmi'
Armor_Class = 5

verb/Equip()
set src in usr
if (usr.icoHead != null)
usr << "You must remove your current item first!"
return
usr.icoHead = src.icon
usr.Armor_Class += src.Armor_Class
src.suffix = "(Equipped)"
usr.Refresh_Overlays()


Head is set to null since theres nothing equipped, so it should have the overlay for the hair.

The hair does show up at login, but once a sword is equipped it (Its the only object I tested) the 'hair' is removed.
In response to Tony WK
Does anyone have a solution? :/
In response to Tony WK
Are you actually setting <code>icoHead=null</code>? I'm not sure whether or not comparing an icon var to null will work as intended or not.
In response to Crispy
Hm, ok, I was using the ever-popular Edit command, and I checked the varaible after my head was removed (From equipping something), when I changed the varaible myself (To the hair), I had used a verb I made, to call the Refresh_Overlays procedure, magically my head reappear'd.

I tryed setting icoHead to null, but no luck.


Is there a way to even set a varaible as an icon? Cause when I tryed

Hair = icon('Head.dmi', "1")


It didn't show up on my edit command as an Icon Varaible.


EDIT:

I found the source of the problem. Whats wrong is, for some stupid ass reason, I cannot get icoHair, nor any other varaible for some odd reason, to equal an icon! Freak'n crazy is all I gotto say.
In response to Tony WK
Tony WK wrote:
I found the source of the problem. Whats wrong is, for some stupid ass reason, I cannot get icoHair, nor any other varaible for some odd reason, to equal an icon! Freak'n crazy is all I gotto say.

Normal variables can't, but we do get handy-dandy icon objects! Try something like this:
var/icon/hair = new('Head.dmi')

Last I checked, that should work.

--Tarmas.