Convert clothing to initialize (#3263)

changes:

Converted all clothing types to Initialize.
Added some missing destroys to some custom items.
Char setup now forcibly initializes the mannequin's contents if SSatoms has not finished yet.
/obj/item/clothing/under no longer does in icon_states() in New().
This commit is contained in:
Lohikar
2017-08-13 15:32:07 -05:00
committed by Erki
parent d1c3a58c87
commit b8bb48ef76
16 changed files with 112 additions and 79 deletions

View File

@@ -67,9 +67,13 @@ All custom items with worn sprites must follow the contained sprite system: http
contained_sprite = TRUE
var/obj/item/weapon/disk/chip
/obj/item/clothing/glasses/fluff/nebula_glasses/New()
/obj/item/clothing/glasses/fluff/nebula_glasses/Initialize()
. = ..()
chip = new /obj/item/weapon/disk/fluff/nebula_chip()
..()
/obj/item/clothing/glasses/fluff/nebula_glasses/Destroy()
QDEL_NULL(chip)
return ..()
/obj/item/clothing/glasses/fluff/nebula_glasses/attack_self(mob/user as mob)
if(chip)
@@ -847,13 +851,16 @@ All custom items with worn sprites must follow the contained sprite system: http
icon_state = "ikrad_beret"
item_state = "ikrad_beret"
contained_sprite = TRUE
var/letter
var/obj/item/fluff/ikrad_letter/letter
/obj/item/clothing/head/beret/engineering/fluff/ikrad_beret/New()
..()
var/obj/item/fluff/ikrad_letter/hat_letter = new(src)
letter = hat_letter
hat_letter.attack_self()
/obj/item/clothing/head/beret/engineering/fluff/ikrad_beret/Initialize()
. = ..()
letter = new(src)
letter.attack_self()
/obj/item/clothing/head/beret/engineering/fluff/ikrad_beret/Destroy()
QDEL_NULL(letter)
return ..()
/obj/item/clothing/head/beret/engineering/fluff/ikrad_beret/attack_self(var/mob/user)
if(letter)
@@ -1160,4 +1167,4 @@ All custom items with worn sprites must follow the contained sprite system: http
/obj/item/clothing/mask/fluff/corvo_cigarette/examine(mob/user)
if(..(user, 1))
user << "It is [active ? "on" : "off"]."
user << "It is [active ? "on" : "off"]."