Skip to content

unbindKey unbinds all #497

@ArranTuna

Description

@ArranTuna

Describe the bug
unbindKey removes more binds than you asked it to, see example.

To Reproduce

function f1()
    outputChatBox("f1")
end
bindKey("1", "down", f1)

function f2()
    outputChatBox("f2")
end
bindKey("1", "down", f2)

function f3()
    outputChatBox("f3 (f1 should stop appearing now, press 2 again, f2 will then stop working)")
    unbindKey("1", "down", f1)
end
bindKey("2", "down", f3)

This can be used to reproduce the bug. Note that if you change bindKey("1", "down", f2) to bindKey("1", "up", f2) then the bug won't happen.

Expected behavior
Only the specified bind should occur.

MTA Client: 1.5.5

MTA Server 1.5.5

Additional context
From https://bugs.mtasa.com/view.php?id=9557

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions