Owner Transform to Owner in SoundSystem calls (#4460)
* Owner Transform to Owner * Owner Transform to Owner minor fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user