ACE3/addons/interaction/functions/fnc_getDoorAnimations.sqf
Phyma 288f956316 Open glass and CUP doors (#5226)
* Fixed glassdoor

Fixed so glassdoor now works with ace slow open.

* Made it more pretty with new file

Made it more pretty with new file

* Tidy up a bit

* Removed white space

* Replace tabs with spaces

Replace tabs with spaces

* Simplified and added comments

* Changes + was stupid was commit

Changes to go with code guidlines and extra check if door is empty

* Tabs to spaces

* Small fixes + Fixed so CUP houses now works

Fixed so CUP houses now works

* Remove todo

* Fixed requested changes

* Removed whitespaces
2017-06-02 16:50:53 -05:00

39 lines
860 B
Plaintext

/*
* 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
*/
#include "script_component.hpp"
params ["_house", "_door"];
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;
[_animations, _lockedVariable]