Fix UseDelay issues (#27336)

* Fix UseDelay issues

- Fix it not predicting properly by deep-copying the classes (realistically they should be structs).
- Fix the `z` path not applying UseDelay similarly to the `e` path.

* click
This commit is contained in:
metalgearsloth
2024-04-26 17:58:06 +10:00
committed by GitHub
parent fe67634397
commit d745a788ea
3 changed files with 35 additions and 4 deletions

View File

@@ -8,11 +8,11 @@ namespace Content.Shared.Timing;
/// Can support additional, separate cooldown timers on the object by passing a unique ID with the system methods.
/// </summary>
[RegisterComponent]
[NetworkedComponent, AutoGenerateComponentState]
[NetworkedComponent]
[Access(typeof(UseDelaySystem))]
public sealed partial class UseDelayComponent : Component
{
[DataField, AutoNetworkedField]
[DataField]
public Dictionary<string, UseDelayInfo> Delays = [];
/// <summary>
@@ -27,6 +27,12 @@ public sealed partial class UseDelayComponent : Component
public TimeSpan Delay = TimeSpan.FromSeconds(1);
}
[Serializable, NetSerializable]
public sealed class UseDelayComponentState : IComponentState
{
public Dictionary<string, UseDelayInfo> Delays = new();
}
[Serializable, NetSerializable]
[DataDefinition]
public sealed partial class UseDelayInfo