diff --git a/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs b/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs index cecc997ecf..5edece1a64 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs @@ -12,7 +12,7 @@ namespace Content.Server.Chemistry.EntitySystems { base.OnReaction(reaction, owner, unitReactions); - SoundSystem.Play(Filter.Pvs(owner), reaction.Sound.GetSound(), owner.Transform.Coordinates); + SoundSystem.Play(Filter.Pvs(owner), reaction.Sound.GetSound(), owner); } } } diff --git a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs index 1483a7b906..7427057ba3 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs @@ -266,7 +266,7 @@ namespace Content.Server.Disposal.Tube.Components } _lastClang = _gameTiming.CurTime; - SoundSystem.Play(Filter.Pvs(Owner), _clangSound.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Pvs(Owner), _clangSound.GetSound(), Owner); break; } } diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index c40a09062b..6de402a834 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -92,7 +92,7 @@ namespace Content.Server.Flash }); } - SoundSystem.Play(Filter.Pvs(comp.Owner), comp.Sound.GetSound(), comp.Owner.Transform.Coordinates, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(comp.Owner), comp.Sound.GetSound(), comp.Owner, AudioParams.Default); return true; } diff --git a/Content.Server/Fluids/Components/PuddleComponent.cs b/Content.Server/Fluids/Components/PuddleComponent.cs index 9949856faf..129b308515 100644 --- a/Content.Server/Fluids/Components/PuddleComponent.cs +++ b/Content.Server/Fluids/Components/PuddleComponent.cs @@ -190,7 +190,7 @@ namespace Content.Server.Fluids.Components return true; } - SoundSystem.Play(Filter.Pvs(Owner), _spillSound.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Pvs(Owner), _spillSound.GetSound(), Owner); return true; } diff --git a/Content.Server/Radiation/RadiationPulseComponent.cs b/Content.Server/Radiation/RadiationPulseComponent.cs index 143b5bf87d..c1a8cb2502 100644 --- a/Content.Server/Radiation/RadiationPulseComponent.cs +++ b/Content.Server/Radiation/RadiationPulseComponent.cs @@ -93,7 +93,7 @@ namespace Content.Server.Radiation _endTime = currentTime + TimeSpan.FromSeconds(_duration); } - SoundSystem.Play(Filter.Pvs(Owner), Sound.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Pvs(Owner), Sound.GetSound(), Owner); Dirty(); } diff --git a/Content.Server/Stunnable/StunbatonSystem.cs b/Content.Server/Stunnable/StunbatonSystem.cs index 61f690b31b..38efd3e26f 100644 --- a/Content.Server/Stunnable/StunbatonSystem.cs +++ b/Content.Server/Stunnable/StunbatonSystem.cs @@ -119,7 +119,7 @@ namespace Content.Server.Stunnable { if (!entity.TryGetComponent(out StunnableComponent? stunnable) || !comp.Activated) return; - SoundSystem.Play(Filter.Pvs(comp.Owner), comp.StunSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(Filter.Pvs(comp.Owner), comp.StunSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); if (!stunnable.SlowedDown) { if (_robustRandom.Prob(comp.ParalyzeChanceNoSlowdown)) @@ -139,7 +139,7 @@ namespace Content.Server.Stunnable if (!comp.Owner.TryGetComponent(out var slot) || slot.Cell == null || !(slot.Cell.CurrentCharge < comp.EnergyPerUse)) return; - SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); TurnOff(comp); } @@ -153,7 +153,7 @@ namespace Content.Server.Stunnable if (!comp.Owner.TryGetComponent(out var sprite) || !comp.Owner.TryGetComponent(out var item)) return; - SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); item.EquippedPrefix = "off"; // TODO stunbaton visualizer sprite.LayerSetState(0, "stunbaton_off"); @@ -177,19 +177,19 @@ namespace Content.Server.Stunnable if (slot.Cell == null) { - SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); user.PopupMessage(Loc.GetString("comp-stunbaton-activated-missing-cell")); return; } if (slot.Cell != null && slot.Cell.CurrentCharge < comp.EnergyPerUse) { - SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); user.PopupMessage(Loc.GetString("comp-stunbaton-activated-dead-cell")); return; } - SoundSystem.Play(playerFilter, comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); + SoundSystem.Play(playerFilter, comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f)); item.EquippedPrefix = "on"; sprite.LayerSetState(0, "stunbaton_on"); diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs index cd0c089371..1f6a0ca9bd 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs @@ -75,12 +75,12 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (value) { TryEjectChamber(); - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } else { TryFeedChamber(); - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } _boltOpen = value; @@ -219,7 +219,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components } else { - SoundSystem.Play(Filter.Pvs(Owner), _soundCycle.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundCycle.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } Dirty(); @@ -248,7 +248,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (_chamberContainer.ContainedEntity == null) { _chamberContainer.Insert(ammo); - SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); Dirty(); UpdateAppearance(); return true; @@ -258,7 +258,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components { _ammoContainer.Insert(ammo); _spawnedAmmo.Push(ammo); - SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); Dirty(); UpdateAppearance(); return true; diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs index 41e12042d4..2da511c079 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs @@ -190,7 +190,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (manual) { - SoundSystem.Play(Filter.Pvs(Owner), _soundCycle.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundCycle.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } Dirty(); @@ -216,7 +216,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components _spawnedAmmo.Push(eventArgs.Using); Dirty(); UpdateAppearance(); - SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); return true; } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs index d02f8d6f97..0d3cfe0aa4 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs @@ -165,7 +165,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components _currentSlot = i; _ammoSlots[i] = entity; _ammoContainer.Insert(entity); - SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); Dirty(); UpdateAppearance(); @@ -192,7 +192,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components { var random = _random.Next(_ammoSlots.Length - 1); _currentSlot = random; - SoundSystem.Play(Filter.Pvs(Owner), _soundSpin.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundSpin.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); Dirty(); } @@ -243,7 +243,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (_ammoContainer.ContainedEntities.Count > 0) { - SoundSystem.Play(Filter.Pvs(Owner), _soundEject.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-1)); + SoundSystem.Play(Filter.Pvs(Owner), _soundEject.GetSound(), Owner, AudioParams.Default.WithVolume(-1)); } // May as well point back at the end? diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs index 1b17844992..7da24a07df 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs @@ -223,7 +223,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components return false; } - SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); _powerCellContainer.Insert(entity); @@ -273,7 +273,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components cell.Owner.Transform.Coordinates = user.Transform.Coordinates; } - SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellEject.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellEject.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); return true; } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs index f7bd19cf98..e176a03e24 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs @@ -98,12 +98,12 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (value) { TryEjectChamber(); - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } else { TryFeedChamber(); - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } _boltOpen = value; @@ -223,7 +223,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (_chamberContainer.ContainedEntity == null && !BoltOpen) { - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen.GetSound(), Owner, AudioParams.Default.WithVolume(-5)); if (Owner.TryGetContainer(out var container)) { @@ -235,7 +235,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (manual) { - SoundSystem.Play(Filter.Pvs(Owner), _soundRack.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundRack.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); } Dirty(); @@ -260,7 +260,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (BoltOpen) { - SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5)); + SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed.GetSound(), Owner, AudioParams.Default.WithVolume(-5)); Owner.PopupMessage(eventArgs.User, Loc.GetString("server-magazine-barrel-component-use-entity-bolt-closed")); BoltOpen = false; return true; @@ -311,7 +311,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (_autoEjectMag && magazine != null && magazine.GetComponent().ShotsLeft == 0) { - SoundSystem.Play(Filter.Pvs(Owner), _soundAutoEject.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundAutoEject.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); _magazineContainer.Remove(magazine); SendNetworkMessage(new MagazineAutoEjectMessage()); @@ -335,7 +335,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components } _magazineContainer.Remove(mag); - SoundSystem.Play(Filter.Pvs(Owner), _soundMagEject.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundMagEject.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); if (user.TryGetComponent(out HandsComponent? handsComponent)) { @@ -371,7 +371,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (_magazineContainer.ContainedEntity == null) { - SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2)); Owner.PopupMessage(eventArgs.User, Loc.GetString("server-magazine-barrel-component-interact-using-success")); _magazineContainer.Insert(eventArgs.Using); Dirty(); diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index 0a588126b6..c647af9292 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -197,7 +197,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components { if (ShotsLeft == 0) { - SoundSystem.Play(Filter.Broadcast(), SoundEmpty.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Broadcast(), SoundEmpty.GetSound(), Owner); return; } @@ -205,7 +205,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components var projectile = TakeProjectile(shooter.Transform.Coordinates); if (projectile == null) { - SoundSystem.Play(Filter.Broadcast(), SoundEmpty.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Broadcast(), SoundEmpty.GetSound(), Owner); return; } @@ -245,7 +245,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components throw new InvalidOperationException(); } - SoundSystem.Play(Filter.Broadcast(), SoundGunshot.GetSound(), Owner.Transform.Coordinates); + SoundSystem.Play(Filter.Broadcast(), SoundGunshot.GetSound(), Owner); _lastFire = _gameTiming.CurTime; } @@ -276,7 +276,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components entity.Transform.Coordinates = entity.Transform.Coordinates.Offset(offsetPos); entity.Transform.LocalRotation = robustRandom.Pick(ejectDirections).ToAngle(); - SoundSystem.Play(Filter.Broadcast(), ammo.SoundCollectionEject.GetSound(), entity.Transform.Coordinates, AudioParams.Default.WithVolume(-1)); + SoundSystem.Play(Filter.Broadcast(), ammo.SoundCollectionEject.GetSound(), entity.Transform.Coordinates, AudioParams.Default.WithVolume(-1)); } ///