View Issue Details

IDProjectCategoryView StatusLast Update
0009178Multi Theft Auto : San AndreasClientpublic2018-07-22 21:58
Reportersam46Assigned ToBonus1702 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.5.2 
Target VersionConfirmed IssuesFixed in Version1.5.6 
Summary0009178: unbindKey not working properly
Description

Function unbindKey works properly only until you bind the same command (function) again to another key.

Test script result:
Both keys ("1", "2") will call "test2" command.
PS: The same result on the server-side.

Steps To Reproduce

Test script (runcode, client-side):

setTimer(function()
addCommandHandler("test2", function() outputDebugString("test") end)
bindKey("1", "down", "test2")
unbindKey("1", "down", "test2")
bindKey("2", "down", "test2")
end, 50, 1)

TagsNo tags attached.

Relationships

related to 0009889 resolvedccw Modified binds are broken in newest MTA (again) 
related to 0008450 closedccw Bind Keeps Removing Itself 

Activities

qaisjp

2016-03-08 20:10

administrator   ~~0024514

What's going on with the timers there?

stumpy

2016-09-29 01:26

viewer   ~~0025255

Last edited: 2016-09-29 01:26

View 2 revisions

image for simplified illustration:
http://prntscr.com/cnkiio

All binds with the self command would be unbinded, also these from other keys.
If you bind the same command again (to same key or different) all binds are back, also the unbinded one.

But looking on the picture is easier.

arranTuna

2018-02-15 16:32

manager   ~~0026430

Last edited: 2018-02-15 16:33

View 2 revisions

Confirmed and only need:

addCommandHandler("test2", function() outputChatBox("test") end)
bindKey("1", "down", "test2")
unbindKey("1", "down", "test2")
bindKey("2", "down", "test2")

Chatbox better since identical debug spam message is no longer shown in debugscript.

einheit-101

2018-06-04 19:36

reporter   ~~0026549

This utterly bugged key binding HAS to be fixed, its an extreme mess and players+scripters complain about it.
unbindKey pretty much doesnt work at all.

ccw

2018-06-04 22:32

administrator   ~~0026550

Try https://nightly.mtasa.com/mtasa-1.5.5-full_rc-12000-20180604.exe

einheit-101

2018-06-05 00:53

reporter   ~~0026551

Thank you, first tests do actually work but i think more testing is needed in order to verify it working 100%!

ccw

2018-06-23 05:59

administrator   ~~0026568

Reverted due to bug:

bindKey("t", "down", "chatbox", "test1");
unbindKey("t", "down", "chatbox", "test1");

bindKey("t", "down", "chatbox", "test2");
unbindKey("t", "down", "chatbox", "test2");  -- Test 2 will not be unbound

Bonus1702

2018-06-23 19:54

reporter   ~~0026574

I created a PR:
https://github.com/multitheftauto/mtasa-blue/pull/201

Bonus1702

2018-06-23 20:01

reporter   ~~0026575

Are you sure with "(function)"?
Can't reproduce the bug with functions, only with commands.
The PR only fixes the command binding & unbinding.

ccw

2018-06-29 20:30

administrator   ~~0026582

https://bugs.mtasa.com/view.php?id=9889

Bonus1702

2018-07-01 03:18

reporter   ~~0026588

New PR:
https://github.com/multitheftauto/mtasa-blue/pull/214

myonlake

2018-07-22 21:11

updater   ~~0026844

Merged in https://github.com/multitheftauto/mtasa-blue/commit/bbd05a541dbca0275c34be5dedddaf776017e382
Buildinfo: https://buildinfo.mtasa.com/?SHA=bbd05a541dbca0275c34be5dedddaf776017e382&Author=&Branch=&Revision=

Issue History

Date Modified Username Field Change