removed TryGetSound + made some SoundSpecifier datafields required

This commit is contained in:
Galactic Chimp
2021-07-31 19:52:33 +02:00
parent 8ff703c338
commit 57016d14b4
114 changed files with 519 additions and 785 deletions

View File

@@ -147,7 +147,8 @@ namespace Content.Server.Weapon.Ranged
return;
}
if(!user.TryGetComponent(out CombatModeComponent? combat) || !combat.IsInCombatMode) {
if (!user.TryGetComponent(out CombatModeComponent? combat) || !combat.IsInCombatMode)
{
return;
}
@@ -167,13 +168,13 @@ namespace Content.Server.Weapon.Ranged
if (ClumsyCheck && ClumsyComponent.TryRollClumsy(user, ClumsyExplodeChance))
{
if(_clumsyWeaponHandlingSound.TryGetSound(out var clumsyWeaponHandlingSound))
SoundSystem.Play(Filter.Pvs(Owner), clumsyWeaponHandlingSound,
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
SoundSystem.Play(
Filter.Pvs(Owner), _clumsyWeaponHandlingSound.GetSound(),
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if(_clumsyWeaponShotSound.TryGetSound(out var clumsyWeaponShotSound))
SoundSystem.Play(Filter.Pvs(Owner), clumsyWeaponShotSound,
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
SoundSystem.Play(
Filter.Pvs(Owner), _clumsyWeaponShotSound.GetSound(),
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if (user.TryGetComponent(out IDamageableComponent? health))
{