Fix stunbaton stun sounds (#9511)
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
using Content.Shared.Sound;
|
||||||
|
|
||||||
namespace Content.Server.Damage.Events;
|
namespace Content.Server.Damage.Events;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -7,4 +9,5 @@ namespace Content.Server.Damage.Events;
|
|||||||
public struct StaminaDamageOnHitAttemptEvent
|
public struct StaminaDamageOnHitAttemptEvent
|
||||||
{
|
{
|
||||||
public bool Cancelled;
|
public bool Cancelled;
|
||||||
|
public SoundSpecifier? HitSoundOverride;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public sealed class StaminaSystem : EntitySystem
|
|||||||
|
|
||||||
if (ev.Cancelled) return;
|
if (ev.Cancelled) return;
|
||||||
|
|
||||||
|
args.HitSoundOverride = ev.HitSoundOverride;
|
||||||
var stamQuery = GetEntityQuery<StaminaComponent>();
|
var stamQuery = GetEntityQuery<StaminaComponent>();
|
||||||
var toHit = new ValueList<StaminaComponent>();
|
var toHit = new ValueList<StaminaComponent>();
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ namespace Content.Server.Stunnable.Systems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.HitSoundOverride = component.StunSound;
|
||||||
|
|
||||||
if (battery.CurrentCharge < component.EnergyPerUse)
|
if (battery.CurrentCharge < component.EnergyPerUse)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(component.SparksSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), uid, AudioHelpers.WithVariation(0.25f));
|
SoundSystem.Play(component.SparksSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), uid, AudioHelpers.WithVariation(0.25f));
|
||||||
|
|||||||
Reference in New Issue
Block a user