Change ``GetPryTimeModifierEvent.BaseTime`` to the TimeSpan (#40419)
* Cleanup * Update
This commit is contained in:
parent
889c918849
commit
134fc9a83e
|
|
@ -264,8 +264,8 @@ public sealed partial class DoorComponent : Component
|
|||
/// <summary>
|
||||
/// Default time that the door should take to pry open.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float PryTime = 1.5f;
|
||||
[DataField]
|
||||
public TimeSpan PryTime = TimeSpan.FromSeconds(1.5f);
|
||||
|
||||
[DataField]
|
||||
public bool ChangeAirtight = true;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public record struct GetPryTimeModifierEvent
|
|||
{
|
||||
public readonly EntityUid User;
|
||||
public float PryTimeModifier = 1.0f;
|
||||
public float BaseTime = 5.0f;
|
||||
public TimeSpan BaseTime = TimeSpan.FromSeconds(5);
|
||||
|
||||
public GetPryTimeModifierEvent(EntityUid user)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -143,13 +143,9 @@ public sealed class PryingSystem : EntitySystem
|
|||
var modEv = new GetPryTimeModifierEvent(user);
|
||||
|
||||
RaiseLocalEvent(target, ref modEv);
|
||||
RaiseLocalEvent(user, ref modEv); // DeltaV - Also raise an event for users to modifiy the time to pry
|
||||
|
||||
// Begin DeltaV additions
|
||||
// Also raise an event for users to modifiy the time to pry
|
||||
RaiseLocalEvent(user, ref modEv);
|
||||
// End DeltaV additions
|
||||
|
||||
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,
|
||||
BreakOnMove = true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue