From 2cdf9b5806118b5fbe24b3dff13e215c3016ca31 Mon Sep 17 00:00:00 2001 From: icomrade Date: Thu, 28 Jul 2016 14:54:50 -0400 Subject: [PATCH] Small fix, revert 1 frame uisleep to regular sleep I wasn't getting errors without if (gear_done) then {}; surrounding the uiSleeps, so I don't quite trust the engine was executing them, I also question the ability of uisleep to handle single frame precision (but I haven't tested anything regarding this yet). --- .../compile/player_countMagazinesWBackpack.sqf | 4 ++-- SQF/dayz_code/compile/player_switchModel.sqf | 6 +++--- SQF/dayz_code/init/compiles.sqf | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SQF/dayz_code/compile/player_countMagazinesWBackpack.sqf b/SQF/dayz_code/compile/player_countMagazinesWBackpack.sqf index 6b3d92dd0..e33e15e87 100644 --- a/SQF/dayz_code/compile/player_countMagazinesWBackpack.sqf +++ b/SQF/dayz_code/compile/player_countMagazinesWBackpack.sqf @@ -48,7 +48,7 @@ if ((typeOf (unitBackPack player)) != "") then { ctrlActivate (_dialog displayCtrl 157); if (gear_done) then { waitUntil {ctrlShown (_dialog displayCtrl 159)}; - uisleep 0.001; + sleep 0.001; }; for "_i" from 5000 to (5000 + _count) do { @@ -67,6 +67,6 @@ if ((typeOf (unitBackPack player)) != "") then { }; (findDisplay 106) closeDisplay 0; -if (gear_done) then {uisleep 0.001;}; +if (gear_done) then {sleep 0.001;}; _magazineArray; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index 6cc4ead24..da2ef64aa 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -128,9 +128,9 @@ if (!isNil "_newBackpackType") then { _backpackWpnQtys = _backpackWpn select 1; }; [] call _switchUnit; - uiSleep 0.001; + if (gear_done) then {Sleep 0.001;}; ["1"] call gearDialog_create; - uiSleep 0.001; + if (gear_done) then {Sleep 0.001;}; //magazines _countr = 0; { @@ -151,7 +151,7 @@ if (!isNil "_newBackpackType") then { }; } count _backpackMag; (findDisplay 106) closeDisplay 0; - if (gear_done) then {uiSleep 0.001; disableUserInput false;}; + if (gear_done) then {Sleep 0.001; disableUserInput false;}; _countr = 0; { diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 09dd54e9c..85c8b43e7 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -366,28 +366,28 @@ if (!isDedicated) then { if (isNil "gear_done") then { gear_done = false; }; openMap false; closeDialog 0; - if (gear_done) then {uisleep 0.001;}; + if (gear_done) then {sleep 0.001;}; player action ["Gear", player]; - if (gear_done) then {uisleep 0.001;}; + if (gear_done) then {sleep 0.001;}; _dialog = findDisplay 106; _i = 0; while {isNull _dialog} do {//DO NOT CHANGE TO A FOR LOOP! _i = _i + 1; _dialog = findDisplay 106; - if (gear_done) then {uisleep 0.001;}; + if (gear_done) then {sleep 0.001;}; if (_i in [100,200,299]) then { closeDialog 0; player action ["Gear", player]; }; if (_i > 300) exitWith {}; }; - if (gear_done) then {uisleep 0.001;}; + if (gear_done) then {sleep 0.001;}; _dialog = findDisplay 106; if ((parseNumber(_this select 0)) != 0) then { ctrlActivate (_dialog displayCtrl 157); if (gear_done) then { waitUntil {ctrlShown (_dialog displayCtrl 159)}; - uisleep 0.001; + sleep 0.001; }; }; gear_done = true;