From 6f9da7a03d3aadd61a1b15b831a91d95d591441c Mon Sep 17 00:00:00 2001 From: Rinary Date: Sat, 19 Oct 2024 22:50:21 +0300 Subject: [PATCH] temp disable damage sounds --- Content.Server/Mech/Systems/MechSystem.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Content.Server/Mech/Systems/MechSystem.cs b/Content.Server/Mech/Systems/MechSystem.cs index feecf4443cb..012aab55a4a 100644 --- a/Content.Server/Mech/Systems/MechSystem.cs +++ b/Content.Server/Mech/Systems/MechSystem.cs @@ -274,10 +274,12 @@ private void OnMechExit(EntityUid uid, MechComponent component, MechExitEvent ar private void OnDamageChanged(EntityUid uid, MechComponent component, DamageChangedEvent args) { + /* if (TryComp(uid, out var damage)) { PlayCritSound(uid, component, damage); } + */ if (args.DamageIncreased && args.DamageDelta != null && component.PilotSlot.ContainedEntity != null) @@ -295,12 +297,12 @@ private void PlayCritSound(EntityUid uid, MechComponent component, DamageableCom var damagePercentage = (total / critThreshold) * 100; if (component.PilotSlot.ContainedEntity != null) { - if (damagePercentage <= 50) - _audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert50), component.PilotSlot.ContainedEntity.Value); - if (damagePercentage <= 75) - _audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert25), component.PilotSlot.ContainedEntity.Value); - if (damagePercentage <= 95) + if (damagePercentage >= 95) _audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert5), component.PilotSlot.ContainedEntity.Value); + else if (damagePercentage >= 75) + _audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert25), component.PilotSlot.ContainedEntity.Value); + else if (damagePercentage >= 50) + _audioSystem.PlayPvs(_audioSystem.GetSound(component.Alert50), component.PilotSlot.ContainedEntity.Value); Dirty(uid ,component); } }