More robust bullet impact sounds (#8325)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.Weapon.Ranged;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Sound;
|
||||
@@ -38,8 +39,12 @@ namespace Content.Server.Projectiles.Components
|
||||
private string? _muzzleFlash;
|
||||
[DataField("impactFlash")]
|
||||
private string? _impactFlash;
|
||||
[DataField("soundHitWall")]
|
||||
private SoundSpecifier _soundHitWall = new SoundPathSpecifier("/Audio/Weapons/Guns/Hits/laser_sear_wall.ogg");
|
||||
|
||||
[DataField("soundHit")]
|
||||
public SoundSpecifier? SoundHit;
|
||||
|
||||
[DataField("soundForce")]
|
||||
public bool ForceSound = false;
|
||||
|
||||
public void FireEffects(EntityUid user, float distance, Angle angle, EntityUid? hitEntity = null)
|
||||
{
|
||||
@@ -80,14 +85,6 @@ namespace Content.Server.Projectiles.Components
|
||||
}
|
||||
}
|
||||
|
||||
if (hitEntity != null && _soundHitWall != null)
|
||||
{
|
||||
// TODO: No wall component so ?
|
||||
var offset = localAngle.ToVec().Normalized / 2;
|
||||
var coordinates = localCoordinates.Offset(offset);
|
||||
SoundSystem.Play(Filter.Pvs(coordinates), _soundHitWall.GetSound(), coordinates);
|
||||
}
|
||||
|
||||
Owner.SpawnTimer((int) _deathTime.TotalMilliseconds, () =>
|
||||
{
|
||||
if (!_entMan.Deleted(Owner))
|
||||
|
||||
Reference in New Issue
Block a user