Remove gun .Owners (#14585)
This commit is contained in:
@@ -29,7 +29,8 @@ public abstract partial class SharedGunSystem
|
||||
|
||||
private void OnBatteryHandleState(EntityUid uid, BatteryAmmoProviderComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not BatteryAmmoProviderComponentState state) return;
|
||||
if (args.Current is not BatteryAmmoProviderComponentState state)
|
||||
return;
|
||||
|
||||
component.Shots = state.Shots;
|
||||
component.Capacity = state.MaxShots;
|
||||
@@ -56,7 +57,8 @@ public abstract partial class SharedGunSystem
|
||||
var shots = Math.Min(args.Shots, component.Shots);
|
||||
|
||||
// Don't dirty if it's an empty fire.
|
||||
if (shots == 0) return;
|
||||
if (shots == 0)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < shots; i++)
|
||||
{
|
||||
@@ -90,15 +92,15 @@ public abstract partial class SharedGunSystem
|
||||
Appearance.SetData(uid, AmmoVisuals.AmmoMax, component.Capacity, appearance);
|
||||
}
|
||||
|
||||
private IShootable GetShootable(BatteryAmmoProviderComponent component, EntityCoordinates coordinates)
|
||||
private (EntityUid? Entity, IShootable) GetShootable(BatteryAmmoProviderComponent component, EntityCoordinates coordinates)
|
||||
{
|
||||
switch (component)
|
||||
{
|
||||
case ProjectileBatteryAmmoProviderComponent proj:
|
||||
var ent = Spawn(proj.Prototype, coordinates);
|
||||
return EnsureComp<AmmoComponent>(ent);
|
||||
return (ent, EnsureComp<AmmoComponent>(ent));
|
||||
case HitscanBatteryAmmoProviderComponent hitscan:
|
||||
return ProtoManager.Index<HitscanPrototype>(hitscan.Prototype);
|
||||
return (null, ProtoManager.Index<HitscanPrototype>(hitscan.Prototype));
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user