Fix equipped weapons rendering wrong for one frame

main
copygirl 4 years ago
parent b803c94200
commit 77e9ed303b
  1. 3
      src/Items/Items.cs
  2. 2
      src/Items/Weapon.cs

@ -57,5 +57,8 @@ public class Items : Node2D, IItems
node.SetProcessInput(value);
node.SetProcessUnhandledInput(value);
node.Visible = value;
// Call _Process when an item is equipped so it
// has a chance to update before it gets drawn.
if (value) node._Process(0);
}
}

@ -47,8 +47,6 @@ public class Weapon : Sprite
public override void _Process(float delta)
{
// FIXME: Need to run _Process after switching to a weapon.
_currentSpreadInc = Mathf.Max(0, _currentSpreadInc - Mathf.Deg2Rad(SpreadRegen) * delta);
_currentRecoil = Mathf.Max(0, _currentRecoil - Mathf.Deg2Rad(RecoilRegen) * delta);

Loading…
Cancel
Save