Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -166,7 +166,7 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
{
|
||||
var arrowVisibility = EntityManager.EnsureComponent<VisibilityComponent>(arrow);
|
||||
layer = playerVisibility.Layer;
|
||||
_visibilitySystem.SetLayer(arrowVisibility, layer);
|
||||
_visibilitySystem.SetLayer(arrow, arrowVisibility, layer);
|
||||
}
|
||||
|
||||
// Get players that are in range and whose visibility layer matches the arrow's.
|
||||
@@ -274,26 +274,28 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
{
|
||||
var currentTime = _gameTiming.CurTime;
|
||||
|
||||
foreach (var component in EntityQuery<PointingArrowComponent>(true))
|
||||
var query = AllEntityQuery<PointingArrowComponent>();
|
||||
while (query.MoveNext(out var uid, out var component))
|
||||
{
|
||||
Update(component, currentTime);
|
||||
Update((uid, component), currentTime);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update(PointingArrowComponent component, TimeSpan currentTime)
|
||||
private void Update(Entity<PointingArrowComponent> pointing, TimeSpan currentTime)
|
||||
{
|
||||
// TODO: That pause PR
|
||||
var component = pointing.Comp;
|
||||
if (component.EndTime > currentTime)
|
||||
return;
|
||||
|
||||
if (component.Rogue)
|
||||
{
|
||||
RemComp<PointingArrowComponent>(component.Owner);
|
||||
EnsureComp<RoguePointingArrowComponent>(component.Owner);
|
||||
RemComp<PointingArrowComponent>(pointing);
|
||||
EnsureComp<RoguePointingArrowComponent>(pointing);
|
||||
return;
|
||||
}
|
||||
|
||||
Del(component.Owner);
|
||||
Del(pointing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user