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
This commit is contained in:
PabstMirror 2023-04-30 16:56:39 -05:00 committed by GitHub
parent 19e88aa8e7
commit 79925b2f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,9 +34,14 @@ _getDoorAnimations params ["_animations"];
if (_animations isEqualTo []) exitWith {}; if (_animations isEqualTo []) exitWith {};
private _lockedVariable = format ["bis_disabled_%1", _door]; 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 // 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]; private _lockedAnimation = format ["%1_locked_source", _door];
TRACE_3("locked",_house,_lockedAnimation,isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)); TRACE_3("locked",_house,_lockedAnimation,isClass (configOf _house >> "AnimationSources" >> _lockedAnimation));
if (isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)) then { if (isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)) then {