From 8aefee0f394345c5b100481a825513fb6b115b1d Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 15 Nov 2022 11:56:10 +1100 Subject: [PATCH] Fix melee sound prediction (#12598) --- Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index 73742fdaa6..2bff6b8bec 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -557,7 +557,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem if (appliedDamage.Total > FixedPoint2.Zero) { - RaiseNetworkEvent(new DamageEffectEvent(Color.Red, targets), Filter.Pvs(Transform(targets[0]).Coordinates, entityMan: EntityManager)); + DoDamageEffect(targets, user, Transform(targets[0])); } } @@ -635,14 +635,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem case "Burn": case "Heat": case "Cold": - Audio.PlayPvs(new SoundPathSpecifier("/Audio/Items/welder.ogg"), target, AudioParams.Default.WithVariation(DamagePitchVariation)); + Audio.PlayPredicted(new SoundPathSpecifier("/Audio/Items/welder.ogg"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation)); break; // No damage, fallback to tappies case null: - Audio.PlayPvs(new SoundPathSpecifier("/Audio/Weapons/tap.ogg"), target, AudioParams.Default.WithVariation(DamagePitchVariation)); + Audio.PlayPredicted(new SoundPathSpecifier("/Audio/Weapons/tap.ogg"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation)); break; case "Brute": - Audio.PlayPvs(new SoundPathSpecifier("/Audio/Weapons/smash.ogg"), target, AudioParams.Default.WithVariation(DamagePitchVariation)); + Audio.PlayPredicted(new SoundPathSpecifier("/Audio/Weapons/smash.ogg"), target, user, AudioParams.Default.WithVariation(DamagePitchVariation)); break; } }