diff --git a/Content.Server/GameObjects/Components/Mobs/FootstepSoundComponent.cs b/Content.Server/GameObjects/Components/Mobs/FootstepSoundComponent.cs new file mode 100644 index 0000000000..7a6cf43fbb --- /dev/null +++ b/Content.Server/GameObjects/Components/Mobs/FootstepSoundComponent.cs @@ -0,0 +1,21 @@ +using Robust.Shared.GameObjects; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Content.Server.Mobs; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.ViewVariables; + +namespace Content.Server.GameObjects.Components.Mobs +{ + /// + /// Mobs will only make footstep sounds if they have this component. + /// + [RegisterComponent] + public class FootstepSoundComponent : Component + { + public override string Name => "FootstepSound"; + } +} diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index 7febdefc70..f20bb0320e 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -1,5 +1,6 @@ using System; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Movement; using Content.Server.Interfaces.GameObjects.Components.Movement; using Content.Shared.Audio; @@ -153,6 +154,12 @@ namespace Content.Server.GameObjects.EntitySystems if (mover.StepSoundDistance > distanceNeeded) { mover.StepSoundDistance = 0; + + if (!mover.Owner.HasComponent()) + { + return; + } + if (mover.Owner.TryGetComponent(out var inventory) && inventory.TryGetSlotItem(EquipmentSlotDefines.Slots.SHOES, out var item) && item.Owner.TryGetComponent(out var modifier)) diff --git a/Resources/Prototypes/Entities/mobs/human.yml b/Resources/Prototypes/Entities/mobs/human.yml index 81404f4f87..fe72758873 100644 --- a/Resources/Prototypes/Entities/mobs/human.yml +++ b/Resources/Prototypes/Entities/mobs/human.yml @@ -67,4 +67,5 @@ - type: Teleportable - type: Examiner - type: CharacterInfo + - type: FootstepSound