Fixes the captains medal being deleted when cryoing (#17667)

This commit is contained in:
Farie82
2022-04-29 13:08:13 +01:00
committed by GitHub
parent b000bd2a88
commit b4a83f650c
4 changed files with 16 additions and 10 deletions
@@ -412,8 +412,7 @@
// Remove accessories from the suit if present
if(length(H.w_uniform?.accessories))
for(var/obj/item/clothing/accessory/A in H.w_uniform.accessories)
A.on_removed(H)
H.w_uniform.accessories -= A
H.w_uniform.detach_accessory(A, null)
H.unEquip(A)
stuff_to_transfer += A
+8 -3
View File
@@ -737,6 +737,13 @@ BLIND // can't see anything
return FALSE
/obj/item/clothing/under/proc/detach_accessory(obj/item/clothing/accessory/A, mob/user)
accessories -= A
A.on_removed(user)
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
/obj/item/clothing/under/examine(mob/user)
. = ..()
switch(sensor_mode)
@@ -802,10 +809,8 @@ BLIND // can't see anything
return
if(!Adjacent(user))
return
A.on_removed(user)
accessories -= A
detach_accessory(A, user)
to_chat(user, "<span class='notice'>You remove [A] from [src].</span>")
usr.update_inv_w_uniform()
/obj/item/clothing/under/emp_act(severity)
if(accessories.len)
@@ -16,10 +16,14 @@
..()
inv_overlay = image("icon" = 'icons/obj/clothing/ties_overlay.dmi', "icon_state" = "[item_color? "[item_color]" : "[icon_state]"]")
/obj/item/clothing/accessory/Moved(atom/OldLoc, Dir, Forced)
. = ..()
if(has_suit)
has_suit.detach_accessory(src, null)
/obj/item/clothing/accessory/Destroy()
if(has_suit)
has_suit.accessories -= src
on_removed(null)
has_suit.detach_accessory(src, null)
return ..()
//when user attached an accessory to S
@@ -702,9 +702,7 @@
if(!thief_mode)
usr.visible_message("<span class='danger'>\The [usr] takes \the [A] off of \the [src]'s [U]!</span>", \
"<span class='danger'>You take \the [A] off of \the [src]'s [U]!</span>")
A.on_removed(usr)
U.accessories -= A
update_inv_w_uniform()
U.detach_accessory(A, usr)
if(href_list["criminal"])
if(hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))