Predicted movement opening lockers (#24937)

Relay wasn't really networked properly and this annoys me.

EntityStorage is still pretty skrunkly but this fixes the main issue I think.
This commit is contained in:
metalgearsloth
2024-02-04 13:23:16 +11:00
committed by GitHub
parent 7d1567281f
commit 042feae2e9
4 changed files with 20 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ public abstract partial class SharedEntityStorageComponent : Component
public readonly float MaxSize = 1.0f; // maximum width or height of an entity allowed inside the storage.
public static readonly TimeSpan InternalOpenAttemptDelay = TimeSpan.FromSeconds(0.5);
public TimeSpan LastInternalOpenAttempt;
public TimeSpan NextInternalOpenAttempt;
/// <summary>
/// Collision masks that get removed when the storage gets opened.
@@ -139,13 +139,16 @@ public sealed class EntityStorageComponentState : ComponentState
public float EnteringRange;
public EntityStorageComponentState(bool open, int capacity, bool isCollidableWhenOpen, bool openOnMove, float enteringRange)
public TimeSpan NextInternalOpenAttempt;
public EntityStorageComponentState(bool open, int capacity, bool isCollidableWhenOpen, bool openOnMove, float enteringRange, TimeSpan nextInternalOpenAttempt)
{
Open = open;
Capacity = capacity;
IsCollidableWhenOpen = isCollidableWhenOpen;
OpenOnMove = openOnMove;
EnteringRange = enteringRange;
NextInternalOpenAttempt = nextInternalOpenAttempt;
}
}