Remove ActiveLagComp (#19572)
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
namespace Content.Server.Movement.Components;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Track lag compensation components that may need to have their data culled for memory reasons.
|
|
||||||
/// </summary>
|
|
||||||
[RegisterComponent]
|
|
||||||
public sealed partial class ActiveLagCompensationComponent : Component
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -36,7 +36,9 @@ public sealed class LagCompensationSystem : EntitySystem
|
|||||||
|
|
||||||
// Cull any old ones from active updates
|
// Cull any old ones from active updates
|
||||||
// Probably fine to include ignored.
|
// 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))
|
while (comp.Positions.TryPeek(out var pos))
|
||||||
{
|
{
|
||||||
@@ -48,11 +50,6 @@ public sealed class LagCompensationSystem : EntitySystem
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comp.Positions.Count == 0)
|
|
||||||
{
|
|
||||||
RemComp<ActiveLagCompensationComponent>(comp.Owner);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +58,6 @@ public sealed class LagCompensationSystem : EntitySystem
|
|||||||
if (!args.NewPosition.EntityId.IsValid())
|
if (!args.NewPosition.EntityId.IsValid())
|
||||||
return; // probably being sent to nullspace for deletion.
|
return; // probably being sent to nullspace for deletion.
|
||||||
|
|
||||||
EnsureComp<ActiveLagCompensationComponent>(uid);
|
|
||||||
component.Positions.Enqueue((_timing.CurTime, args.NewPosition, args.NewRotation));
|
component.Positions.Enqueue((_timing.CurTime, args.NewPosition, args.NewRotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user