Skip to content

Fix unbindKey removing every script bind on the key - #5324

Open
Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/497-unbindkey
Open

Fix unbindKey removing every script bind on the key#5324
Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/497-unbindkey

Conversation

@Flashmyname

Copy link
Copy Markdown

Fixes #497.

All script binds on a key go through one shared core bind, and unbindKey removed that shared bind whenever the script side found nothing to remove. So unbinding a function twice, or one that was never bound, silenced every other handler on that key in every resource. It now only goes once no script bind is left, and returns false when nothing was removed.

Tested with two resources bound to the same key: the other handlers survive, and the second unbind returns false instead of killing both.

Only drop the core bind that dispatches the script binds once no script bind is
left on that key and state, and return false when nothing was unbound.

Fixes multitheftauto#497.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unbindKey unbinds all

1 participant