Change `GetPryTimeModifierEvent.BaseTime` to the TimeSpan (#40419)

* Cleanup

* Update
This commit is contained in:
Winkarst-cpu
2025-09-17 16:03:51 +03:00
committed by GitHub
parent 599b962234
commit 0dd1733998
3 changed files with 4 additions and 4 deletions

View File

@@ -264,8 +264,8 @@ public sealed partial class DoorComponent : Component
/// <summary> /// <summary>
/// Default time that the door should take to pry open. /// Default time that the door should take to pry open.
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField]
public float PryTime = 1.5f; public TimeSpan PryTime = TimeSpan.FromSeconds(1.5f);
[DataField] [DataField]
public bool ChangeAirtight = true; public bool ChangeAirtight = true;

View File

@@ -86,7 +86,7 @@ public record struct GetPryTimeModifierEvent
{ {
public readonly EntityUid User; public readonly EntityUid User;
public float PryTimeModifier = 1.0f; public float PryTimeModifier = 1.0f;
public float BaseTime = 5.0f; public TimeSpan BaseTime = TimeSpan.FromSeconds(5);
public GetPryTimeModifierEvent(EntityUid user) public GetPryTimeModifierEvent(EntityUid user)
{ {

View File

@@ -134,7 +134,7 @@ public sealed class PryingSystem : EntitySystem
var modEv = new GetPryTimeModifierEvent(user); var modEv = new GetPryTimeModifierEvent(user);
RaiseLocalEvent(target, ref modEv); RaiseLocalEvent(target, ref modEv);
var doAfterArgs = new DoAfterArgs(EntityManager, user, TimeSpan.FromSeconds(modEv.BaseTime * modEv.PryTimeModifier / toolModifier), new DoorPryDoAfterEvent(), target, target, tool) var doAfterArgs = new DoAfterArgs(EntityManager, user, modEv.BaseTime * modEv.PryTimeModifier / toolModifier, new DoorPryDoAfterEvent(), target, target, tool)
{ {
BreakOnDamage = true, BreakOnDamage = true,
BreakOnMove = true, BreakOnMove = true,