Fixes bodypart movespeed modifiers (#76520)

## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/82850673/502a195b-b9d6-48fd-92a1-462e74a13ae0)
I am today's big loser

Fixes https://github.com/tgstation/tgstation/issues/76509 (partly)
This was caused by my goofy ass not using the correct proc for the
VARIABLE movespeed modifier that is the bodypart one.

Additionally slightly changes some bodypart code that bothered me by
using signals even though it was just... not really necessary? And kind
of confusing?

## Why It's Good For The Game

Bugs are bad they make you mad

## Changelog

🆑
fix: Bodyparts that should slow you down, will slow you down.
/🆑
This commit is contained in:
ChungusGamer666
2023-07-04 17:43:12 +01:00
committed by GitHub
parent 2aec1bc790
commit b09f982408
4 changed files with 27 additions and 33 deletions
@@ -649,6 +649,15 @@
SEND_SIGNAL(src, COMSIG_BODYPART_CHANGED_OWNER, new_owner, old_owner)
var/needs_update_disabled = FALSE //Only really relevant if there's an owner
if(old_owner)
if(held_index)
old_owner.on_lost_hand(src)
if(old_owner.hud_used)
var/atom/movable/screen/inventory/hand/hand = old_owner.hud_used.hand_slots["[held_index]"]
if(hand)
hand.update_appearance()
old_owner.update_worn_gloves()
if(speed_modifier)
old_owner.update_bodypart_speed_modifier()
if(length(bodypart_traits))
old_owner.remove_traits(bodypart_traits, bodypart_trait_source)
if(initial(can_be_disabled))
@@ -664,6 +673,15 @@
))
UnregisterSignal(old_owner, COMSIG_ATOM_RESTYLE)
if(owner)
if(held_index)
owner.on_added_hand(src, held_index)
if(owner.hud_used)
var/atom/movable/screen/inventory/hand/hand = owner.hud_used.hand_slots["[held_index]"]
if(hand)
hand.update_appearance()
owner.update_worn_gloves()
if(speed_modifier)
owner.update_bodypart_speed_modifier()
if(length(bodypart_traits))
owner.add_traits(bodypart_traits, bodypart_trait_source)
if(initial(can_be_disabled))
@@ -92,11 +92,8 @@
SEND_SIGNAL(owner, COMSIG_CARBON_REMOVE_LIMB, src, dismembered)
SEND_SIGNAL(src, COMSIG_BODYPART_REMOVED, owner, dismembered)
update_limb(dropping_limb = TRUE)
//limb is out and about, it can't really be considered an implant
bodypart_flags &= ~BODYPART_IMPLANTED
bodypart_flags &= ~BODYPART_IMPLANTED //limb is out and about, it can't really be considered an implant
owner.remove_bodypart(src)
if(speed_modifier)
owner.update_bodypart_speed_modifier()
for(var/datum/wound/wound as anything in wounds)
wound.remove_wound(TRUE)
@@ -125,7 +122,7 @@
if(!special)
if(phantom_owner.dna)
for(var/datum/mutation/human/mutation as anything in phantom_owner.dna.mutations) //some mutations require having specific limbs to be kept.
if(mutation.limb_req && mutation.limb_req == body_zone)
if(mutation.limb_req && (mutation.limb_req == body_zone))
to_chat(phantom_owner, span_warning("You feel your [mutation] deactivating from the loss of your [body_zone]!"))
phantom_owner.dna.force_lose(mutation)
@@ -331,15 +328,6 @@
moveToNullspace()
set_owner(new_limb_owner)
new_limb_owner.add_bodypart(src)
if(held_index)
new_limb_owner.on_added_hand(src, held_index)
if(new_limb_owner.hud_used)
var/atom/movable/screen/inventory/hand/hand = new_limb_owner.hud_used.hand_slots["[held_index]"]
if(hand)
hand.update_appearance()
new_limb_owner.update_worn_gloves()
if(speed_modifier)
new_limb_owner.update_bodypart_speed_modifier()
if(special) //non conventional limb attachment
for(var/datum/surgery/attach_surgery as anything in new_limb_owner.surgeries) //if we had an ongoing surgery to attach a new limb, we stop it.