I am guessing you are storing the last moved direction to render the correct facing for the wolf, which might be the reason why while jumping the 'x' vector might be adding unnecessarily (had the same bug in my platformer) or something like that.
Jumping near cliffs become pretty risky😬