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

Disable footstep sounds for ghosts #343

Merged
merged 2 commits into from
Sep 20, 2019
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions Content.Server/GameObjects/EntitySystems/MoverSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ private void UpdateKinematics(ITransformComponent transform, IMoverComponent mov
if (mover.StepSoundDistance > distanceNeeded)
{
mover.StepSoundDistance = 0;

if (mover.Owner.Prototype.ID == "MobObserver" || mover.Owner.Prototype.ID == "AdminObserver")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should absolutely be done by checking for the existence of a component.

Make a component that makes something make footstep sounds and add it to humans.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added FootstepSoundComponent. It's just an empty component that's checked for in MoverSystem.cs instead of checking the prototype names. Figured I'd start with that simple approach, but if you wanted it to do more lemme know.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, that's perfect.

{
return;
}

if (mover.Owner.TryGetComponent<InventoryComponent>(out var inventory)
&& inventory.TryGetSlotItem<ItemComponent>(EquipmentSlotDefines.Slots.SHOES, out var item)
&& item.Owner.TryGetComponent<FootstepModifierComponent>(out var modifier))
Expand Down