CUModSquad / Camelot-Unchained

UI repository for Camelot Unchained, a tri-realm RvR MMORPG.
Mozilla Public License 2.0
7 stars 25 forks source link

Fix UI Crash when unbinding a key #279

Closed Mehuge closed 5 years ago

Mehuge commented 5 years ago

This PR fixes an issue whereby the UI crashes when trying to unbind a key.

I also changed gameTasks to handle cancelled better. A cancelled promise will not trigger a resolve, but if the game engine does resolve it when its been cancelled, the promise is rejected with { cancelled: true }.

Also added debugs to gameTasks (under game.debug) as cancelling the keybind listener is not working, I suspect its not the promise code, but rather the listener code, in which case the debugs can be removed again.

Also, when removing a keybind, the code did not attempt to cancel the listener, it should.