Weapons warnings cleanup (#36164)
* Weapons warnings cleanup * Changes to audio on Reflection stuff
This commit is contained in:
@@ -118,11 +118,7 @@ public sealed class ReflectSystem : EntitySystem
|
||||
var newRot = rotation.RotateVec(locRot.ToVec());
|
||||
_transform.SetLocalRotation(projectile, newRot.ToAngle());
|
||||
|
||||
if (_netManager.IsServer)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("reflect-shot"), user);
|
||||
_audio.PlayPvs(reflect.SoundOnReflect, user, AudioHelpers.WithVariation(0.05f, _random));
|
||||
}
|
||||
PlayAudioAndPopup(reflect, user);
|
||||
|
||||
if (Resolve(projectile, ref projectileComp, false))
|
||||
{
|
||||
@@ -154,6 +150,16 @@ public sealed class ReflectSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayAudioAndPopup(ReflectComponent reflect, EntityUid user)
|
||||
{
|
||||
// Can probably be changed for prediction
|
||||
if (_netManager.IsServer)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("reflect-shot"), user);
|
||||
_audio.PlayPvs(reflect.SoundOnReflect, user);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryReflectHitscan(
|
||||
EntityUid user,
|
||||
EntityUid reflector,
|
||||
@@ -172,11 +178,7 @@ public sealed class ReflectSystem : EntitySystem
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_netManager.IsServer)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("reflect-shot"), user);
|
||||
_audio.PlayPvs(reflect.SoundOnReflect, user, AudioHelpers.WithVariation(0.05f, _random));
|
||||
}
|
||||
PlayAudioAndPopup(reflect, user);
|
||||
|
||||
var spread = _random.NextAngle(-reflect.Spread / 2, reflect.Spread / 2);
|
||||
newDirection = -spread.RotateVec(direction);
|
||||
|
||||
Reference in New Issue
Block a user