mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
90647c5495
* 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
30 lines
920 B
Plaintext
30 lines
920 B
Plaintext
#include "script_component.hpp"
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
private _cfgAction = configFile >> "CfgActions" >> "Eject";
|
|
GVAR(ejectActionParams) = [
|
|
[
|
|
"", // will be set with setUserActionText
|
|
{
|
|
params ["_vehicle", "_unit"];
|
|
private _preserveEngineOn = (_unit == driver _vehicle) && {isEngineOn _vehicle};
|
|
moveOut _unit;
|
|
if (_preserveEngineOn) then {
|
|
// vehicle is local to last driver, no need to care
|
|
_vehicle engineOn true;
|
|
};
|
|
},
|
|
nil,
|
|
getNumber (_cfgAction >> "priority"),
|
|
false,
|
|
true,
|
|
getText (_cfgAction >> "shortcut"),
|
|
'[_this, _target] call DFUNC(canShowEject)'
|
|
],
|
|
getText (_cfgAction >> "text"),
|
|
getText (_cfgAction >> "textDefault")
|
|
];
|
|
|
|
["Helicopter", "initPost", LINKFUNC(initEjectAction)] call CBA_fnc_addClassEventHandler;
|