diff --git a/dayz_code/compile/fn_selfActions.sqf b/dayz_code/compile/fn_selfActions.sqf index e315202e6..c11f33d45 100644 --- a/dayz_code/compile/fn_selfActions.sqf +++ b/dayz_code/compile/fn_selfActions.sqf @@ -213,7 +213,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6)) }; //Allow owner to unlock vault - if(cursorTarget isKindOf "VaultStorageLocked" and _canDo and _ownerID != "0") then { + if(cursorTarget isKindOf "VaultStorageLocked" and _canDo and _ownerID != "0" and !UnlockInprogress) then { if (_ownerID == dayz_playerUID) then { if (s_player_unlockvault < 0 and (player distance cursorTarget < 3)) then { s_player_unlockvault = player addAction ["Unlock Vault", "\z\addons\dayz_code\actions\vault_unlock.sqf",cursorTarget, 0, false, true, "",""]; diff --git a/dayz_code/compile/player_unlockVault.sqf b/dayz_code/compile/player_unlockVault.sqf index 6303a4703..e470f9e66 100644 --- a/dayz_code/compile/player_unlockVault.sqf +++ b/dayz_code/compile/player_unlockVault.sqf @@ -11,6 +11,8 @@ player playActionNow "Medic"; player removeAction s_player_unlockvault; s_player_unlockvault = 1; +UnlockInprogress = true; + _item = "ItemToolbox"; _hasToolbox = _item in items player; @@ -140,3 +142,4 @@ if(_allowunlock) then { }; s_player_unlockvault = -1; +UnlockInprogress = false; diff --git a/dayz_code/init/variables.sqf b/dayz_code/init/variables.sqf index 3625ed847..02b919576 100644 --- a/dayz_code/init/variables.sqf +++ b/dayz_code/init/variables.sqf @@ -351,6 +351,7 @@ if(!isDedicated) then { dayz_Magazines = []; dayzGearSave = false; dayz_unsaved = false; + UnlockInprogress = false; dayz_scaleLight = 0; dayzDebug = false; dayzState = -1;