Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixes taur legs + augments not getting the correct footstep sounds from prefs #5106

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
if(value == "Default")
return

var/list/value_to_define = list(
var/static/list/value_to_define = list(
"Shoes" = FOOTSTEP_MOB_SHOE,
"Claws" = FOOTSTEP_MOB_CLAW,
)
var/footstep_type = value_to_define[value]

var/obj/item/bodypart/leg/left_leg = target.get_bodypart(BODY_ZONE_L_LEG)
var/obj/item/bodypart/leg/right_leg = target.get_bodypart(BODY_ZONE_R_LEG)
var/footstep_type = value_to_define[value]
left_leg.footstep_type = footstep_type
right_leg.footstep_type = footstep_type

target.footstep_type = footstep_type // We are most likely going to have our legs get replaced during char creation immediately, so this is necessary to apply to any subsequent legs that get added.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/mob/living/carbon/human
/// Used for footstep type pref, to apply to any new legs that get added to this mob. Uses a var instead of checking prefs because there are a lot of clientless mob situations.
var/footstep_type

/mob/living/carbon/human/Initialize(mapload)
. = ..()
mob_examine_panel = new(src) //create the datum
Expand Down
6 changes: 6 additions & 0 deletions modular_nova/modules/bodyparts/code/_mutant_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
/// This is used in digitigrade legs, when this leg is swapped out with the digitigrade version.
var/digitigrade_type = /obj/item/bodypart/leg/left/digitigrade

// Just blanket apply the footstep pref on limb addition, it gets far too complicated otherwise as limbs are getting replaced more often than you'd think
/obj/item/bodypart/leg/on_adding(mob/living/carbon/new_owner)
. = ..()
var/mob/living/carbon/human/human_owner = new_owner
if(istype(human_owner) && human_owner.footstep_type)
footstep_type = human_owner.footstep_type

/// General mutant bodyparts. Used in most mutant species.
/obj/item/bodypart/head/mutant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
new_limb.limb_id = BODYPART_ID_DIGITIGRADE
new_limb.base_limb_id = BODYPART_ID_DIGITIGRADE
new_limb.bodyshape = old_limb.bodyshape

new_limb.replace_limb(augmented, special = TRUE)
qdel(old_limb)

Expand Down
Loading