Remove ActiveLagComp (#19572)

This commit is contained in:
metalgearsloth
2023-08-27 14:35:52 +10:00
committed by GitHub
parent 8195690b8c
commit 33e15145ba
2 changed files with 3 additions and 17 deletions

View File

@@ -36,7 +36,9 @@ public sealed class LagCompensationSystem : EntitySystem
// Cull any old ones from active updates
// Probably fine to include ignored.
foreach (var (_, comp) in EntityQuery<ActiveLagCompensationComponent, LagCompensationComponent>(true))
var query = EntityQueryEnumerator<LagCompensationComponent>();
while (query.MoveNext(out var comp))
{
while (comp.Positions.TryPeek(out var pos))
{
@@ -48,11 +50,6 @@ public sealed class LagCompensationSystem : EntitySystem
break;
}
if (comp.Positions.Count == 0)
{
RemComp<ActiveLagCompensationComponent>(comp.Owner);
}
}
}
@@ -61,7 +58,6 @@ public sealed class LagCompensationSystem : EntitySystem
if (!args.NewPosition.EntityId.IsValid())
return; // probably being sent to nullspace for deletion.
EnsureComp<ActiveLagCompensationComponent>(uid);
component.Positions.Enqueue((_timing.CurTime, args.NewPosition, args.NewRotation));
}