Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Power.EntitySystems;
|
||||
|
||||
@@ -18,11 +16,14 @@ public sealed partial class CableSystem
|
||||
SubscribeLocalEvent<CablePlacerComponent, AfterInteractEvent>(OnCablePlacerAfterInteract);
|
||||
}
|
||||
|
||||
private void OnCablePlacerAfterInteract(EntityUid uid, CablePlacerComponent component, AfterInteractEvent args)
|
||||
private void OnCablePlacerAfterInteract(Entity<CablePlacerComponent> placer, ref AfterInteractEvent args)
|
||||
{
|
||||
if (args.Handled || !args.CanReach) return;
|
||||
if (args.Handled || !args.CanReach)
|
||||
return;
|
||||
|
||||
if (component.CablePrototypeId == null) return;
|
||||
var component = placer.Comp;
|
||||
if (component.CablePrototypeId == null)
|
||||
return;
|
||||
|
||||
if(!_mapManager.TryGetGrid(args.ClickLocation.GetGridUid(EntityManager), out var grid))
|
||||
return;
|
||||
@@ -39,7 +40,7 @@ public sealed partial class CableSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryComp<StackComponent>(component.Owner, out var stack) && !_stack.Use(component.Owner, 1, stack))
|
||||
if (TryComp<StackComponent>(placer, out var stack) && !_stack.Use(placer, 1, stack))
|
||||
return;
|
||||
|
||||
var newCable = EntityManager.SpawnEntity(component.CablePrototypeId, grid.GridTileToLocal(snapPos));
|
||||
|
||||
Reference in New Issue
Block a user