ACE3/addons/aircraft/functions/fnc_canShowEject.sqf
Dystopian 90647c5495 Replace Helicopter eject configs with universal scripted action (#5384)
* Remove eject config entries

* Add scripted Eject action

* Fix engine stop on driver eject

* Clean up

* Use config instead object for CBA_fnc_getTurret

* Optimize, add commander turret init

* Restore role in var name

* Use single qoutes instead QUOTE macro
2017-09-18 00:24:14 +02:00

35 lines
798 B
Plaintext

/*
* 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
*/
#include "script_component.hpp"
#define FULLCREW_UNIT 0
#define FULLCREW_ROLE 1
#define FULLCREW_TURRETPATH 3
params ["_unit", "_vehicle"];
_vehicle == vehicle _unit
&& {
private _ejectVarName = "";
{
if (_unit == _x select FULLCREW_UNIT) exitWith {
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
};
} count fullCrew _vehicle;
_vehicle getVariable [_ejectVarName, false]
}