Fix a few warnings (#11576)

This commit is contained in:
metalgearsloth
2022-10-04 14:24:19 +11:00
committed by GitHub
parent a6d20803a6
commit 600c0e3255
43 changed files with 185 additions and 167 deletions

View File

@@ -44,7 +44,7 @@ public abstract partial class SharedGunSystem
component.Entities.Add(args.Used);
component.Container.Insert(args.Used);
// Not predicted so
PlaySound(uid, component.SoundInsert?.GetSound(Random, ProtoManager), args.User);
Audio.PlayPredicted(component.SoundInsert, uid, args.User);
args.Handled = true;
UpdateBallisticAppearance(component);
Dirty(component);
@@ -80,10 +80,7 @@ public abstract partial class SharedGunSystem
}
Dirty(component);
var sound = component.SoundRack?.GetSound(Random, ProtoManager);
if (sound != null)
PlaySound(component.Owner, sound, user);
Audio.PlayPredicted(component.SoundRack, component.Owner, user);
var shots = GetBallisticShots(component);
component.Cycled = true;
@@ -208,9 +205,11 @@ public abstract partial class SharedGunSystem
private void UpdateBallisticAppearance(BallisticAmmoProviderComponent component)
{
if (!Timing.IsFirstTimePredicted || !TryComp<AppearanceComponent>(component.Owner, out var appearance)) return;
appearance.SetData(AmmoVisuals.AmmoCount, GetBallisticShots(component));
appearance.SetData(AmmoVisuals.AmmoMax, component.Capacity);
if (!Timing.IsFirstTimePredicted || !TryComp<AppearanceComponent>(component.Owner, out var appearance))
return;
Appearance.SetData(appearance.Owner, AmmoVisuals.AmmoCount, GetBallisticShots(component), appearance);
Appearance.SetData(appearance.Owner, AmmoVisuals.AmmoMax, component.Capacity, appearance);
}
[Serializable, NetSerializable]