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.
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.