From b8dba25cc5429d114667e1dd9459cab8ded02634 Mon Sep 17 00:00:00 2001 From: oiad Date: Sun, 3 Sep 2017 13:56:06 +1200 Subject: [PATCH] Only allow lock removal if door is unlocked --- SQF/dayz_code/compile/fn_selfActions.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index ef93fac0d..df2165a83 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -13,7 +13,7 @@ private ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_t "_isModular","_isModularDoor","_isHouse","_isGateOperational","_isGateLockable","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock", "_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo", "_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar", -"_allowed","_hasAccess","_uid","_myCharID","_isLocked"]; +"_allowed","_hasAccess","_uid","_myCharID","_isLocked","_isDoorUnlocked"]; _vehicle = vehicle player; _inVehicle = (_vehicle != player); @@ -846,7 +846,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur s_player_downgrade_build = -1; }; }; - if (s_player_downgrade_build < 0) then { + _isDoorUnlocked = (((_cursorTarget animationPhase "Open_door" == 0) && (_cursorTarget animationPhase "Open_hinge" == 1)) || ((_cursorTarget animationPhase "Open_door" == 0) && (_cursorTarget animationPhase "Open_latch" == 1))); + if (s_player_downgrade_build < 0 && _isDoorUnlocked) then { _hasAccess = [player, _cursorTarget] call FNC_check_access; if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then { s_player_lastTarget set [1,_cursorTarget];