mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Handle locked doors (#5345)
This commit is contained in:
parent
f210f63bd9
commit
cddc34e08a
@ -19,20 +19,25 @@
|
|||||||
private _info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor);
|
private _info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor);
|
||||||
|
|
||||||
_info params ["_house", "_door"];
|
_info params ["_house", "_door"];
|
||||||
|
TRACE_2("openDoor",_house,_door);
|
||||||
|
|
||||||
if (isNull _house) exitWith {};
|
if (isNull _house) exitWith {};
|
||||||
|
|
||||||
private _getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations);
|
private _getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations);
|
||||||
|
|
||||||
_getDoorAnimations params ["_animations", "_lockedVariable"];
|
_getDoorAnimations params ["_animations"];
|
||||||
|
|
||||||
if (_animations isEqualTo []) exitWith {};
|
if (_animations isEqualTo []) exitWith {};
|
||||||
|
|
||||||
|
private _lockedVariable = format ["bis_disabled_%1", _door];
|
||||||
|
|
||||||
//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 (!(isNil (_lockedVariable select 0))) then {
|
if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable, 0] == 1}) exitWith {
|
||||||
if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith {
|
private _lockedAnimation = format ["%1_locked_source", _door];
|
||||||
_lockedVariable set [0, _house];
|
TRACE_3("locked",_house,_lockedAnimation,isClass (configfile >> "CfgVehicles" >> (typeOf _house) >> "AnimationSources" >> _lockedAnimation));
|
||||||
_lockedVariable call BIS_fnc_LockedDoorOpen;
|
if (isClass (configfile >> "CfgVehicles" >> (typeOf _house) >> "AnimationSources" >> _lockedAnimation)) then {
|
||||||
|
// from: a3\structures_f\scripts\fn_door.sqf: - wiggles the door handle (A3 buildings)
|
||||||
|
_house animateSource [_lockedAnimation, (1 - (_house animationSourcePhase _lockedAnimation))];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user