Fix cuffing in harm mode sometimes not working (#13701)
This commit is contained in:
@@ -29,6 +29,12 @@ public sealed class MeleeWeaponComponent : Component
|
|||||||
[ViewVariables(VVAccess.ReadWrite), DataField("nextAttack", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
[ViewVariables(VVAccess.ReadWrite), DataField("nextAttack", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||||
public TimeSpan NextAttack;
|
public TimeSpan NextAttack;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts attack cooldown when equipped if true.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite), DataField("resetOnHandSelected")]
|
||||||
|
public bool ResetOnHandSelected = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Melee combat works based around 2 types of attacks:
|
* Melee combat works based around 2 types of attacks:
|
||||||
* 1. Click attacks with left-click. This attacks whatever is under your mnouse
|
* 1. Click attacks with left-click. This attacks whatever is under your mnouse
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
if (component.AttackRate.Equals(0f))
|
if (component.AttackRate.Equals(0f))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!component.ResetOnHandSelected)
|
||||||
|
return;
|
||||||
|
|
||||||
// If someone swaps to this weapon then reset its cd.
|
// If someone swaps to this weapon then reset its cd.
|
||||||
var curTime = Timing.CurTime;
|
var curTime = Timing.CurTime;
|
||||||
var minimum = curTime + TimeSpan.FromSeconds(1 / component.AttackRate);
|
var minimum = curTime + TimeSpan.FromSeconds(1 / component.AttackRate);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- Handcuffs
|
- Handcuffs
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
|
resetOnHandSelected: false
|
||||||
animation: WeaponArcDisarm
|
animation: WeaponArcDisarm
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
|
|||||||
Reference in New Issue
Block a user