mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
8f46ffd8d5
count -> forEach Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
36 lines
828 B
Plaintext
36 lines
828 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: Dystopian
|
|
* Check if Eject action can be shown.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit who calls action <OBJECT>
|
|
* 1: Vehicle which action is attached to <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Can show <BOOL>
|
|
*
|
|
* Example:
|
|
* [player, vehicle player] call ace_aircraft_fnc_canShowEject
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#define FULLCREW_UNIT 0
|
|
#define FULLCREW_ROLE 1
|
|
#define FULLCREW_TURRETPATH 3
|
|
|
|
params ["_unit", "_vehicle"];
|
|
|
|
_vehicle == vehicle _unit
|
|
&& {2 > locked _vehicle}
|
|
&& {
|
|
private _ejectVarName = "";
|
|
{
|
|
if (_unit == _x select FULLCREW_UNIT) exitWith {
|
|
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
|
|
};
|
|
} forEach fullCrew _vehicle;
|
|
_vehicle getVariable [_ejectVarName, false]
|
|
}
|