From f03f116dfcad1b70f249bb78dad95f6c6d255df1 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 3 Dec 2016 16:50:55 -0500 Subject: [PATCH] Fix Arma cheats still enterable under certain circumstances Thanks to Epoch forums user Golgofinyanin for reporting. https://epochmod.com/forum/profile/13156-golgofinyanin/ --- CHANGE LOG 1.0.6.1.txt | 1 + SQF/dayz_code/compile/keyboard.sqf | 2 +- SQF/dayz_code/compile/player_filterCheats.sqf | 7 +++++-- SQF/dayz_code/init/variables.sqf | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index 4774a89c6..67f11675c 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -1,4 +1,5 @@ [FIXED] Wrong texture for z_hunter zombie. #1805 @schwanzkopfhegel @ebayShopper [FIXED] Refuel with generator at gas station not working. #1806 @Helios27 @ebayShopper +[FIXED] Issue where Arma cheats could still be entered under certain conditions without pressing LeftShift at the same time as NumPadMinus. @ebayShopper [INFO] See Documents\CHANGE LOG 1.0.6.txt for the full list of 1.0.5.1 --> 1.0.6 changes. \ No newline at end of file diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index 6b7b4714d..7d8441ae8 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -266,7 +266,7 @@ if (isNil "keyboard_keys") then { [[DIK_Q], {DZE_4 = true;}] call _addArray; [[DIK_E], {DZE_6 = true;}] call _addArray; [[DIK_0], _autoRun] call _addArray; - [[DIK_NUMPADMINUS], _filterCheat] call _addArray; + [[DIK_NUMPADMINUS,DIK_LSHIFT], _filterCheat] call _addArray; [[DIK_SPACE], {DZE_5 = true;}] call _addArray; [actionKeys "User6", {DZE_F = true;}] call _addArray; [actionKeys "User7", {DZE_Q_ctrl = true;}] call _addArray; diff --git a/SQF/dayz_code/compile/player_filterCheats.sqf b/SQF/dayz_code/compile/player_filterCheats.sqf index eccb970bd..6220921d4 100644 --- a/SQF/dayz_code/compile/player_filterCheats.sqf +++ b/SQF/dayz_code/compile/player_filterCheats.sqf @@ -20,8 +20,11 @@ _inputAction2 = {inputAction _x > 0} count ["NextChannel","PrevChannel"]; _channelChange = _micIcon && ((!isNull findDisplay 24 && _dik in [DIK_DOWN,DIK_UP]) or (_dik in channel_keys) or (_inputAction2 > 0)); _blockVoice = _channelChange or ((_dik in voice_keys or (_inputAction1 > 0)) && (_channel in DZE_DisabledChannels)); -if ((_dik == DIK_NUMPADMINUS && _shift) or _blockVoice) then { - if (!_blockVoice) then {call player_forceSave;}; //Perform before disableUserInput to prevent reenable +if (_dik == DIK_NUMPADMINUS) then {dayz_minusDownTime = diag_tickTime;}; +_blockCheat = (_dik == DIK_NUMPADMINUS && _shift) or (_dik == DIK_LSHIFT && (diag_tickTime - dayz_minusDownTime < 2)); + +if (_blockCheat or _blockVoice) then { + if (_blockCheat) then {call player_forceSave;}; //Perform before disableUserInput to prevent reenable disableUserInput true;disableUserInput true; if (_blockVoice) then {findDisplay 55 closeDisplay 2;}; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 3b7e9845b..ceca9264d 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -713,4 +713,5 @@ if (!isDedicated) then { DZE_InRadiationZone = false; DZE_myVehicle = objNull; dayz_groupNameTags = true; + dayz_minusDownTime = 0; };