meteor-rejects icon indicating copy to clipboard operation
meteor-rejects copied to clipboard

[Suggestion] don't unregister keypresses in stopMomentum

Open Cypphi opened this issue 2 years ago • 3 comments

Describe the bug

Toggling off Flight while holding a key will unregister the key so you have to press the key again to be able to walk.

I looked at the code and tried fixing it but can't really find a way, I understand why this happens but can't think of a way myself to fix it.

Steps to reproduce

1. enable stopMomentum in the flight module
2. toggle on flight
3. fly
4. toggle off flight (while pressing W,A,S,D)
5. You're not moving in the direction of what key you're pressing

Operating System

Windows

Rejects Version

latest

Meteor Version

latest dev build

Minecraft Version

1.17.1

Other mods

none

Cypphi avatar Sep 18 '21 12:09 Cypphi

Probably due to this

A fix I can think off is to cancel player velocity (set to 0) instead of setting the keypress to false

sbxte avatar Sep 18 '21 12:09 sbxte

it is setting player velocity to 0 right here, but it doesn't work properly without unregistering keypresses

C10udburst avatar Sep 18 '21 12:09 C10udburst

it is setting player velocity to 0 right here, but it doesn't work properly without unregistering keypresses

Yeah what's the deal with that? I actually tried fixing it myself and just setting velocity to 0 but it doesn't work for some weird reason...

Cypphi avatar Sep 30 '21 07:09 Cypphi