Owner Transform to Owner in SoundSystem calls (#4460)
* Owner Transform to Owner * Owner Transform to Owner minor fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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<PowerCellSlotComponent>(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<SpriteComponent>(out var sprite) ||
|
||||
!comp.Owner.TryGetComponent<ItemComponent>(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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<RangedMagazineComponent>().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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user