More miscellaneous compiler warning fixes (#18228)
This commit is contained in:
@@ -78,7 +78,7 @@ public abstract partial class SharedGunSystem
|
||||
|
||||
Audio.PlayPredicted(component.SoundModeToggle, uid, user);
|
||||
Popup(Loc.GetString("gun-selected-mode", ("mode", GetLocSelector(fire))), uid, user);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Systems;
|
||||
|
||||
@@ -164,7 +165,7 @@ public partial class SharedGunSystem
|
||||
Popup(Loc.GetString("gun-revolver-insert"), revolverUid, user);
|
||||
UpdateRevolverAppearance(revolverUid, component);
|
||||
UpdateAmmoCount(uid);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -223,6 +224,7 @@ public partial class SharedGunSystem
|
||||
return count;
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
private int GetRevolverUnspentCount(RevolverAmmoProviderComponent component)
|
||||
{
|
||||
var count = 0;
|
||||
@@ -261,7 +263,8 @@ public partial class SharedGunSystem
|
||||
|
||||
if (slot == null)
|
||||
{
|
||||
if (chamber == null) continue;
|
||||
if (chamber == null)
|
||||
continue;
|
||||
|
||||
// Too lazy to make a new method don't sue me.
|
||||
if (!_netManager.IsClient)
|
||||
@@ -294,7 +297,7 @@ public partial class SharedGunSystem
|
||||
Audio.PlayPredicted(component.SoundEject, revolverUid, user);
|
||||
UpdateAmmoCount(revolverUid);
|
||||
UpdateRevolverAppearance(revolverUid, component);
|
||||
Dirty(component);
|
||||
Dirty(revolverUid, component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,12 +369,12 @@ public partial class SharedGunSystem
|
||||
component.AmmoContainer.Remove(ent.Value);
|
||||
component.AmmoSlots[index] = null;
|
||||
args.Ammo.Add((ent.Value, EnsureComp<AmmoComponent>(ent.Value)));
|
||||
Transform(ent.Value).Coordinates = args.Coordinates;
|
||||
TransformSystem.SetCoordinates(ent.Value, args.Coordinates);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateRevolverAppearance(uid, component);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void Cycle(RevolverAmmoProviderComponent component, int count = 1)
|
||||
|
||||
@@ -329,7 +329,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
CauseImpulse(fromCoordinates, toCoordinates.Value, user, userPhysics);
|
||||
}
|
||||
|
||||
Dirty(gun);
|
||||
Dirty(gunUid, gun);
|
||||
}
|
||||
|
||||
public void Shoot(
|
||||
@@ -366,7 +366,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
protected void SetCartridgeSpent(EntityUid uid, CartridgeAmmoComponent cartridge, bool spent)
|
||||
{
|
||||
if (cartridge.Spent != spent)
|
||||
Dirty(cartridge);
|
||||
Dirty(uid, cartridge);
|
||||
|
||||
cartridge.Spent = spent;
|
||||
Appearance.SetData(uid, AmmoVisuals.Spent, spent);
|
||||
@@ -380,14 +380,14 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
bool playSound = true)
|
||||
{
|
||||
// TODO: Sound limit version.
|
||||
var offsetPos = (Random.NextVector2(EjectOffset));
|
||||
var offsetPos = Random.NextVector2(EjectOffset);
|
||||
var xform = Transform(entity);
|
||||
|
||||
var coordinates = xform.Coordinates;
|
||||
coordinates = coordinates.Offset(offsetPos);
|
||||
|
||||
xform.LocalRotation = Random.NextAngle();
|
||||
xform.Coordinates = coordinates;
|
||||
TransformSystem.SetLocalRotation(xform, Random.NextAngle());
|
||||
TransformSystem.SetCoordinates(entity, xform, coordinates);
|
||||
|
||||
if (playSound && TryComp<CartridgeAmmoComponent>(entity, out var cartridge))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user