Hoodies stay unzipped/zipped (#9600)

This commit is contained in:
Hockaa
2020-08-06 20:18:44 +01:00
committed by GitHub
parent 20df578662
commit 246c81b202
2 changed files with 22 additions and 9 deletions
+16 -9
View File
@@ -3,8 +3,9 @@
/obj/item/clothing/suit/storage/hooded
var/obj/item/clothing/head/winterhood/hood
var/hoodtype = null
var/suittoggled = 0
var/suittoggled = FALSE
var/hooded = 0
var/lasticonstate
/obj/item/clothing/suit/storage/hooded/Initialize()
. = ..()
@@ -24,10 +25,14 @@
..()
/obj/item/clothing/suit/storage/hooded/proc/RemoveHood()
icon_state = initial(icon_state)
item_state = initial(item_state)
suittoggled = 0
if(!lasticonstate)
suittoggled = FALSE
else
icon_state = lasticonstate
item_state = lasticonstate
suittoggled = FALSE
// Hood got nuked. Probably because of RIGs or the like.
if (!hood)
MakeHood()
@@ -64,8 +69,9 @@
to_chat(H, "<span class='warning'>You're already wearing something on your head!</span>")
return
else
lasticonstate = icon_state
H.equip_to_slot_if_possible(hood,slot_head,0,0,1)
suittoggled = 1
suittoggled = TRUE
icon_state = "[initial(icon_state)]_t"
item_state = "[initial(item_state)]_t"
H.update_inv_wear_suit()
@@ -239,12 +245,13 @@
to_chat(H, "<span class='warning'>You're already wearing something on your head!</span>")
return
else
lasticonstate = icon_state
H.equip_to_slot_if_possible(hood,slot_head,0,0,1)
suittoggled = 1
suittoggled = TRUE
icon_open = "[initial(icon_open)]_t" // this is where the change is.
icon_closed = "[initial(icon_closed)]_t"
icon_state = "[initial(icon_state)]_t"
item_state = "[initial(item_state)]_t"
icon_state = "[icon_state]_t"
item_state = "[item_state]_t"
H.update_inv_wear_suit()
else
RemoveHood()