From 8a7d937999dd58a7e6d733e8278343c26a31cee0 Mon Sep 17 00:00:00 2001 From: A Man Date: Sat, 16 Apr 2022 17:09:59 +0200 Subject: [PATCH] Fix freezing player gear when changing clothes Thx to iben for the help --- SQF/dayz_code/init/compiles.sqf | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index c4aed8c7d..601f9c91b 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -413,23 +413,23 @@ if (!isDedicated) then { }; gearDialog_create = { - private ["_i","_dialog"]; + disableSerialization; if (!isNull (findDisplay 106)) then { (findDisplay 106) closeDisplay 0; }; openMap false; closeDialog 0; - if (gear_done) then {sleep 0.001;}; + if (gear_done) then {uiSleep 0.001;}; DZE_GearCheckBypass = true; //Bypass gear menu checks since dialog will always open on player's gear skipGearSound = true; //Don't play sound when checking backpack mags ammo count player action ["Gear", player]; - if (gear_done) then {sleep 0.001;}; - _dialog = findDisplay 106; - _i = 0; + if (gear_done) then {uiSleep 0.001;}; + local _dialog = findDisplay 106; + local _i = 0; while {isNull _dialog} do { _i = _i + 1; _dialog = findDisplay 106; - if (gear_done) then {sleep 0.001;}; + if (gear_done) then {uiSleep 0.001;}; if (_i in [100,200,299]) then { closeDialog 0; DZE_GearCheckBypass = true; //Bypass gear menu checks since dialog will always open on player's gear @@ -438,13 +438,19 @@ if (!isDedicated) then { }; if (_i > 300) exitWith {}; }; - if (gear_done) then {sleep 0.001;}; - _dialog = findDisplay 106; + if (gear_done) then { + waitUntil { + uiSleep 0.1; + _dialog = findDisplay 106; + !isNull _dialog + }; + }; + if ((parseNumber(_this select 0)) != 0) then { ctrlActivate (_dialog displayCtrl 157); if (gear_done) then { waitUntil {ctrlShown (_dialog displayCtrl 159)}; - sleep 0.001; + uiSleep 0.001; }; }; skipGearSound = false;