AscendStop Fires Too Often
TylerPentecost opened this issue ยท 1 comments
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
- Log in to the game
- Ensure the addon is enabled for the test character
- Log into the game world
- Enter the /jc command to get the current jump count
- Press the Spacebar to jump
- While still in the air, press the Spacebar again (no jump will occur because the player is in the air)
- 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.