From bdd0192168d67763e608c67e75308daf22cd285d Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 30 Mar 2022 09:07:06 -0500 Subject: [PATCH] Fix jumpsuits to drop accessories when destroyed (#65768) Fixes #65103 and probably some other edge cases. Medals of captaincy are an indestructible antag objective. If you attached the medal to the jumpsuit and somehow destroyed it, it would delete all the accessories on it. Now when jumpsuits are destroyed, they drop their accessories to the floor. --- code/modules/clothing/under/_under.dm | 12 ++++++------ code/modules/holodeck/computer.dm | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 36bddde2b8b..60fcada6d47 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -23,6 +23,12 @@ var/mutantrace_variation = NO_MUTANTRACE_VARIATION //Are there special sprites for specific situations? Don't use this unless you need to. var/freshly_laundered = FALSE +/obj/item/clothing/under/Initialize(mapload) + . = ..() + if(random_sensor) + //make the sensor mode favor higher levels, except coords. + sensor_mode = pick(SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_LIVING, SENSOR_LIVING, SENSOR_COORDS, SENSOR_COORDS, SENSOR_OFF) + /obj/item/clothing/under/worn_overlays(mutable_appearance/standing, isinhands = FALSE) . = ..() if(isinhands) @@ -63,12 +69,6 @@ else if(damaged_state == CLOTHING_PRISTINE && has_sensor == BROKEN_SENSORS) has_sensor = HAS_SENSORS -/obj/item/clothing/under/Initialize(mapload) - . = ..() - if(random_sensor) - //make the sensor mode favor higher levels, except coords. - sensor_mode = pick(SENSOR_OFF, SENSOR_LIVING, SENSOR_LIVING, SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_COORDS, SENSOR_COORDS) - /obj/item/clothing/under/emp_act(severity) . = ..() if(. & EMP_PROTECT_SELF) diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index 1be1ff84445..b559a0db1cb 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -315,6 +315,10 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf for(var/atom/movable/atom_contents as anything in holo_atom) //make sure that things inside of a holoitem are moved outside before destroying it atom_contents.forceMove(target_turf) + if(istype(holo_atom, /obj/item/clothing/under/rank)) + var/obj/item/clothing/under/holo_clothing = holo_atom + holo_clothing.dump_attachment() + if(!silent) visible_message(span_notice("[holo_atom] fades away!"))