Jump Counter (Classic)

Jump Counter (Classic)

5k Downloads

AscendStop Fires Too Often

TylerPentecost opened this issue ยท 1 comments

commented

AscendStop is called when the jump key is released. This happens both when the player is in the middle of the jump and when the player held down the Spacebar until the jump finished. This means repeated pressing the Spacebar while the character is in the process of the last jump will still increment the counter.

Steps to Reproduce

  1. Log in to the game
  2. Ensure the addon is enabled for the test character
  3. Log into the game world
  4. Enter the /jc command to get the current jump count
  5. Press the Spacebar to jump
  6. While still in the air, press the Spacebar again (no jump will occur because the player is in the air)
  7. Enter the /jc command to get the current jump count

Actual Outcome

The jump count has incremented twice.

Expected Outcome

The jump count has incremented once.

Recommendations

I have not thought through this much yet, but I suspect hooking into the JumpOrAscendStart and checking if the IsFalling() method returns false will accomplish the Expected Outcome. Afterall, if the JumpOrAscendStart hook fires every time a jump starts, we do not wish to increment the jump counter when IsFalling() returns true to avoid Spacebar presses where jumping is impossible.

commented

As it has been a year and a half with no response, I am going to close this issue.