ACE3/addons/interaction/functions/fnc_getDoorAnimations.sqf

39 lines
860 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: commy2, Phyma
* Get door animations.
*
* Arguments:
* 0: House <OBJECT>
* 1: Door <STRING>
*
* Return Value:
* Animation and Locked variable <ARRAY>
* 0: Animation <STRING>
* 1: Locked variable <STRING>
*
* Example:
* array = [target, "door"] call ace_interaction_fnc_getDoorAnimations
*
* Public: No
*/
2015-01-11 19:32:51 +00:00
params ["_house", "_door"];
2015-01-11 19:32:51 +00:00
private _animate = animationNames _house;
private _animations = [];
private _lockedVariable = [];
{
private _animName = toLower _x;
if ((_animName find (toLower _door)) != -1) then {
if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then {
_lockedVariable pushBack _animName;
} else {
_animations pushBack _animName;
};
};
} forEach _animate;
2015-01-11 19:32:51 +00:00
[_animations, _lockedVariable]