From 837ac80dd8039d493b4a357e827a65fa9379e15f Mon Sep 17 00:00:00 2001 From: Lucy Date: Mon, 1 Jul 2024 00:31:44 -0400 Subject: [PATCH] Fix runtime with cybernetic bodypart overlays (#2468) --- .../modules/cybernetics/augments/_base_changes.dm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/monkestation/code/modules/cybernetics/augments/_base_changes.dm b/monkestation/code/modules/cybernetics/augments/_base_changes.dm index b4efe1b01517..1872722458b7 100644 --- a/monkestation/code/modules/cybernetics/augments/_base_changes.dm +++ b/monkestation/code/modules/cybernetics/augments/_base_changes.dm @@ -82,16 +82,19 @@ add_to_limb(ownerlimb) /obj/item/organ/internal/cyberimp/add_to_limb(obj/item/bodypart/bodypart) - bodypart_overlay = new bodypart_overlay() - bodypart_overlay.unique_properties(src) ownerlimb = bodypart - ownerlimb.add_bodypart_overlay(bodypart_overlay) + var/bodypart_overlay_path = src::bodypart_overlay + if(ispath(bodypart_overlay_path)) + bodypart_overlay = new bodypart_overlay_path + bodypart_overlay.unique_properties(src) + ownerlimb.add_bodypart_overlay(bodypart_overlay) owner.update_body_parts() return ..() /obj/item/organ/internal/cyberimp/remove_from_limb() - ownerlimb.remove_bodypart_overlay(bodypart_overlay) - QDEL_NULL(bodypart_overlay) + if(istype(bodypart_overlay)) + ownerlimb.remove_bodypart_overlay(bodypart_overlay) + QDEL_NULL(bodypart_overlay) ownerlimb = null owner.update_body_parts() return ..()