2015-04-05 06:57:24 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-12-16 19:22:18 +00:00
|
|
|
[QGVAR(addMagazine), {
|
|
|
|
params ["_static", "_magazine"];
|
|
|
|
_static addMagazineTurret [_magazine,[0]];
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-12-16 19:22:18 +00:00
|
|
|
|
|
|
|
[QGVAR(removeMagazine), {
|
|
|
|
params ["_static", "_magazine"];
|
|
|
|
_static removeMagazineTurret [_magazine,[0]];
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-12-16 19:22:18 +00:00
|
|
|
|
|
|
|
[QGVAR(setAmmo), {
|
|
|
|
params ["_static", "_magazine","_ammoCount"];
|
|
|
|
_static setMagazineTurretAmmo [_magazine, _ammoCount, [0]];
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-12-19 01:18:35 +00:00
|
|
|
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_initMortar", {_this call FUNC(mortarInit);}] call CBA_fnc_addEventHandler;
|
2016-03-14 13:21:02 +00:00
|
|
|
|
2016-11-16 17:00:50 +00:00
|
|
|
if (hasInterface) then {
|
|
|
|
["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler;
|
|
|
|
};
|
2015-12-19 01:18:35 +00:00
|
|
|
|
2016-11-16 17:00:50 +00:00
|
|
|
["ace_settingsInitialized", {
|
|
|
|
TRACE_1("ace_settingsInitialized",GVAR(useAmmoHandling));
|
|
|
|
|
|
|
|
["vehicle", FUNC(handlePlayerVehicleChanged), true] call CBA_fnc_addPlayerEventHandler;
|
|
|
|
|
|
|
|
if (GVAR(useAmmoHandling)) then {
|
|
|
|
["Mortar_01_base_F", "init", {
|
|
|
|
TRACE_2("mortar init",_this,(_this select 0) turretLocal [0]);
|
|
|
|
|
|
|
|
//wait for proper turret locality change
|
|
|
|
[{
|
|
|
|
TRACE_2("after delay",_this,(_this select 0) turretLocal [0]);
|
|
|
|
["ace_initMortar", _this] call CBA_fnc_localEvent;
|
|
|
|
}, _this, 0.5] call CBA_fnc_waitAndExecute;
|
|
|
|
|
|
|
|
}, true, [], true] call CBA_fnc_addClassEventHandler;
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|