Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 07b10e4

Browse files
committed
Fix unused HDFirearm function and repurpose it for fixing staggered fire
1 parent 50f4173 commit 07b10e4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Entities/AHuman.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,6 +3306,8 @@ void AHuman::Update()
33063306
if (deviceAsFirearm->FiredOnce()) {
33073307
m_CanActivateBGItem = true;
33083308
m_TriggerPulled = true;
3309+
} else {
3310+
m_CanActivateBGItem = !deviceAsFirearm->CanFire();
33093311
}
33103312
}
33113313
}
@@ -3402,6 +3404,8 @@ void AHuman::Update()
34023404
if (deviceAsFirearm->FiredOnce()) {
34033405
m_CanActivateBGItem = false;
34043406
m_TriggerPulled = true;
3407+
} else {
3408+
m_CanActivateBGItem = deviceAsFirearm->CanFire();
34053409
}
34063410
}
34073411
} else {

Entities/HDFirearm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ AddScriptFunctionNames(HeldDevice, "OnFire", "OnReload");
821821
/// Gets whether this HDFirearm is ready to be fired.
822822
/// </summary>
823823
/// <returns>Whether this HDFirearm is ready to pop another Round.</returns>
824-
bool CanFire() const { return m_ActivationTimer.IsPastSimMS(GetMSPerRound()); }
824+
bool CanFire() const { return m_LastFireTmr.IsPastSimMS(GetMSPerRound()); }
825825

826826
/// <summary>
827827
/// Gets whether this HDFirearm is halfway to be fired. Used for evenly spacing out dual-wielded fire.

0 commit comments

Comments
 (0)