Skip to content

Commit

Permalink
less errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Oct 9, 2023
1 parent d8bb4af commit 771c9cb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions code/modules/surgery/bodyparts/dismemberment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,19 @@
if(!owner)
return
var/atom/drop_loc = owner.drop_location()
var/mob/living/carbon/phantom_owner

SEND_SIGNAL(owner, COMSIG_CARBON_REMOVE_LIMB, src, dismembered)
SEND_SIGNAL(src, COMSIG_BODYPART_REMOVED, owner, dismembered)
update_limb(TRUE)
owner.bodyparts -= src
phantom_owner.bodyparts -= src

if(held_index)
if(owner.hand_bodyparts[held_index] == src)
if(phantom_owner.hand_bodyparts[held_index] == src)
// We only want to do this if the limb being removed is the active hand part.
// This catches situations where limbs are "hot-swapped" such as augmentations and roundstart prosthetics.
owner.dropItemToGround(owner.get_item_for_held_index(held_index), 1)
owner.hand_bodyparts[held_index] = null
phantom_owner.dropItemToGround(owner.get_item_for_held_index(held_index), 1)
phantom_owner.hand_bodyparts[held_index] = null

/*
for(var/datum/wound/wound as anything in wounds)
Expand All @@ -109,8 +110,6 @@
LAZYREMOVE(owner.all_scars, scar)
*/

var/mob/living/carbon/phantom_owner = null // so we can still refer to the guy who lost their limb after said limb forgets 'em

for(var/datum/surgery/surgery as anything in phantom_owner.surgeries) //if we had an ongoing surgery on that limb, we stop it.
if(surgery.operated_bodypart == src)
phantom_owner.surgeries -= surgery
Expand Down

0 comments on commit 771c9cb

Please sign in to comment.