Fix bang, ded (#10768)
This commit is contained in:
@@ -225,6 +225,9 @@ public sealed partial class GunSystem : SharedGunSystem
|
|||||||
|
|
||||||
public void PlayImpactSound(EntityUid otherEntity, DamageSpecifier? modifiedDamage, SoundSpecifier? weaponSound, bool forceWeaponSound)
|
public void PlayImpactSound(EntityUid otherEntity, DamageSpecifier? modifiedDamage, SoundSpecifier? weaponSound, bool forceWeaponSound)
|
||||||
{
|
{
|
||||||
|
if (Deleted(otherEntity))
|
||||||
|
return;
|
||||||
|
|
||||||
// Like projectiles and melee,
|
// Like projectiles and melee,
|
||||||
// 1. Entity specific sound
|
// 1. Entity specific sound
|
||||||
// 2. Ammo's sound
|
// 2. Ammo's sound
|
||||||
@@ -237,24 +240,20 @@ public sealed partial class GunSystem : SharedGunSystem
|
|||||||
|
|
||||||
if (type != null && rangedSound.SoundTypes?.TryGetValue(type, out var damageSoundType) == true)
|
if (type != null && rangedSound.SoundTypes?.TryGetValue(type, out var damageSoundType) == true)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(damageSoundType!.GetSound(),
|
Audio.PlayPvs(damageSoundType, otherEntity, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||||
Filter.Pvs(otherEntity, entityManager: EntityManager),
|
|
||||||
otherEntity, AudioHelpers.WithVariation(DamagePitchVariation));
|
|
||||||
|
|
||||||
playedSound = true;
|
playedSound = true;
|
||||||
}
|
}
|
||||||
else if (type != null && rangedSound.SoundGroups?.TryGetValue(type, out var damageSoundGroup) == true)
|
else if (type != null && rangedSound.SoundGroups?.TryGetValue(type, out var damageSoundGroup) == true)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(damageSoundGroup!.GetSound(),
|
Audio.PlayPvs(damageSoundGroup, otherEntity, AudioParams.Default.WithVariation(DamagePitchVariation));
|
||||||
Filter.Pvs(otherEntity, entityManager: EntityManager),
|
|
||||||
otherEntity, AudioHelpers.WithVariation(DamagePitchVariation));
|
|
||||||
|
|
||||||
playedSound = true;
|
playedSound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!playedSound && weaponSound != null)
|
if (!playedSound && weaponSound != null)
|
||||||
SoundSystem.Play(weaponSound.GetSound(), Filter.Pvs(otherEntity, entityManager: EntityManager), otherEntity);
|
{
|
||||||
|
Audio.PlayPvs(weaponSound, otherEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Pseudo RNG so the client can predict these.
|
// TODO: Pseudo RNG so the client can predict these.
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||||||
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
|
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
|
||||||
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
|
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
|
||||||
[Dependency] protected readonly TagSystem TagSystem = default!;
|
[Dependency] protected readonly TagSystem TagSystem = default!;
|
||||||
|
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
||||||
[Dependency] protected readonly SharedProjectileSystem Projectiles = default!;
|
[Dependency] protected readonly SharedProjectileSystem Projectiles = default!;
|
||||||
|
|
||||||
protected ISawmill Sawmill = default!;
|
protected ISawmill Sawmill = default!;
|
||||||
|
|||||||
@@ -15,11 +15,30 @@
|
|||||||
sprite: Objects/Weapons/Guns/Pistols/debug.rsi
|
sprite: Objects/Weapons/Guns/Pistols/debug.rsi
|
||||||
- type: Gun
|
- type: Gun
|
||||||
fireRate: 100
|
fireRate: 100
|
||||||
- type: BallisticAmmoProvider
|
selectedMode: FullAuto
|
||||||
|
availableModes:
|
||||||
|
- SemiAuto
|
||||||
|
- FullAuto
|
||||||
|
- type: AmmoCounter
|
||||||
|
- type: ChamberMagazineAmmoProvider
|
||||||
|
- type: ItemSlots
|
||||||
|
slots:
|
||||||
|
gun_magazine:
|
||||||
|
name: Magazine
|
||||||
|
startingItem: MagazinePistolDebug
|
||||||
|
insertSound: /Audio/Weapons/Guns/MagIn/smg_magin.ogg
|
||||||
|
ejectSound: /Audio/Weapons/Guns/MagOut/smg_magout.ogg
|
||||||
|
priority: 2
|
||||||
whitelist:
|
whitelist:
|
||||||
tags:
|
tags:
|
||||||
- Debug
|
- Debug
|
||||||
proto: MagazinePistolDebug
|
gun_chamber:
|
||||||
|
name: Chamber
|
||||||
|
startingItem: CartridgeDebug
|
||||||
|
priority: 1
|
||||||
|
whitelist:
|
||||||
|
tags:
|
||||||
|
- CartridgePistol
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: MagazinePistolDebug
|
id: MagazinePistolDebug
|
||||||
|
|||||||
Reference in New Issue
Block a user