From 79925b2f76ec69ab945f63d12ad410fe52a0fafc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Apr 2023 16:56:39 -0500 Subject: [PATCH] Interaction - Fix opening locked doors for GM buildings (#9154) * Interaction - Fix opening locked doors for GM buildings Fix #9143 * Update addons/interaction/functions/fnc_openDoor.sqf --- addons/interaction/functions/fnc_openDoor.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index fae63a9533..8a0fef1209 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -34,9 +34,14 @@ _getDoorAnimations params ["_animations"]; if (_animations isEqualTo []) exitWith {}; private _lockedVariable = format ["bis_disabled_%1", _door]; +private _lockedVariableAlt = _lockedVariable; // GM Buildings may have door names like door_01 but locking expects door_1 +if ((count _door == 7) && {(_door select [0, 6]) == "door_0"}) then { + _lockedVariableAlt = format ["bis_disabled_door_%1", _door select [6, 1]]; // stip off the leading zero then check both vars +}; // Check if the door can be locked aka have locked variable, otherwhise cant lock it -if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable, 0] == 1}) exitWith { +if ((_house animationPhase (_animations select 0) <= 0) && + {(_house getVariable [_lockedVariable, 0] == 1) || {_house getVariable [_lockedVariableAlt, 0] == 1}}) exitWith { private _lockedAnimation = format ["%1_locked_source", _door]; TRACE_3("locked",_house,_lockedAnimation,isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)); if (isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)) then {