From c1110fc61c7c9684cae6fc3af066a73b1deadded Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Mon, 13 Nov 2017 17:34:43 -0500 Subject: [PATCH] Fix a rare error with keyboard_keys Some combo binds will cause actionKeys to return a number greater than six digits. See AgentRev's note: https://community.bistudio.com/wiki/actionKeys An example is NumLock + P [1.15763e+009]. Using a number this large as an index errors out. Example: test_array = []; test_array set [9999991,true]; But six digits or less will not error: test_array = []; test_array set [999999,true]; --- CHANGE LOG 1.0.6.2.txt | 1 + SQF/dayz_code/compile/keyboard.sqf | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGE LOG 1.0.6.2.txt b/CHANGE LOG 1.0.6.2.txt index 77a2afd14..c18075bf7 100644 --- a/CHANGE LOG 1.0.6.2.txt +++ b/CHANGE LOG 1.0.6.2.txt @@ -74,6 +74,7 @@ [FIXED] Launchers and launcher ammo are now detected correctly in the sell menu when a player has a launcher and ammo with the same classname. [FIXED] Wrong bleeding icon on Epoch legacy status UI [FIXED] A locked door can now be auto unlocked right after placement by the player who built it +[FIXED] A rare error in keyboard.sqf for certain combination binds. [NOTE] Fixes below were included in hotfix 1.0.6.1A (March 10th 2017) and are now in the default files. [FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions. diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index dfbd09f6a..a1fea2863 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -240,7 +240,9 @@ if (isNil "keyboard_keys") then { _addArray = { { - keyboard_keys set [_x, _this select 1]; + if (_x <= 999999) then { + keyboard_keys set [_x, _this select 1]; + }; } forEach (_this select 0); };