Skip to content

Commit

Permalink
Fixes taur legs + augments not getting the correct footstep sounds fr…
Browse files Browse the repository at this point in the history
…om prefs (#4475)

* Fixes taur legs not getting the correct footstep sounds from prefs

* Fixes augments not getting the correct footstep from prefs

* Update limbs.dm

* Let us try this a different way

* OK, we're doing it like this then.

* Update human.dm

* Update footstep_sound.dm
  • Loading branch information
vinylspiders authored and StealsThePRs committed Oct 15, 2024
1 parent 7bc81cb commit 2592502
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
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

0 comments on commit 2592502

Please sign in to comment.