Skip to content

Commit

Permalink
Rework lastFireTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 14, 2024
1 parent ef88b49 commit c201da6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public static CoopObservedFirearmController Create(CoopPlayer player, Weapon wea
public override void ManualUpdate(float deltaTime)
{
base.ManualUpdate(deltaTime);
if (Time.time - lastFireTime > 0.05f)
lastFireTime += deltaTime;
if (lastFireTime > 0.05f)
{
if (hasFired)
{
Expand Down Expand Up @@ -295,7 +296,7 @@ public void HandleShotInfoPacket(ref ShotInfoPacket packet, InventoryController
FirearmsAnimator.SetFire(true);
DryShot();
hasFired = true;
lastFireTime = Time.time;
lastFireTime = 0f;
return;
}

Expand Down Expand Up @@ -333,7 +334,7 @@ private void HandleObservedShot(ref ShotInfoPacket packet, InventoryController i

triggerPressed = false;
hasFired = true;
lastFireTime = Time.time;
lastFireTime = 0f;
if (Weapon.SelectedFireMode == Weapon.EFireMode.fullauto)
{
needsReset = true;
Expand Down

0 comments on commit c201da6

Please sign in to comment.