Skip to content

Commit

Permalink
Add fix for #228
Browse files Browse the repository at this point in the history
  • Loading branch information
Fueredoriku committed Oct 16, 2023
1 parent 753567c commit d4d6eec
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Assets/Scripts/Augment/AugmentImplementations/DDRBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class DDRBody : GunBody

private const float targetHeight = 3;
private const float startHeight = targetHeight - screenHeight;
private const float lowestCheckHeight = 2.5f;

[SerializeField]
private Precision[] precisionsGoodToBad;
Expand Down Expand Up @@ -126,6 +127,9 @@ private void Fire(InputAction.CallbackContext ctx)

private void ArrowSelect(InputAction.CallbackContext ctx)
{
if (arrowHeight < lowestCheckHeight)
return;

switch (arrowDirection)
{
case ArrowDirection.NORTH:
Expand Down Expand Up @@ -193,7 +197,12 @@ private void ResetArrow()

private void OnDestroy()
{
if (gunController)
gunController.player.inputManager.onMovePerformed -= ArrowSelect;
if (!gunController)
return;
if (!gunController.player)
return;

gunController.player.inputManager.onFirePerformed -= Fire;
gunController.player.inputManager.onMovePerformed -= ArrowSelect;
}
}

0 comments on commit d4d6eec

Please sign in to comment.