Skip to content

Commit

Permalink
Fix runtime with cybernetic bodypart overlays (#2468)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Jul 1, 2024
1 parent 0212e79 commit 837ac80
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions monkestation/code/modules/cybernetics/augments/_base_changes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()
Expand Down

0 comments on commit 837ac80

Please sign in to comment.