2016-07-14 14:16:53 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
[QGVAR(engineFire), FUNC(engineFire)] call CBA_fnc_addEventHandler;
|
2021-10-14 15:49:27 +00:00
|
|
|
[QGVAR(cookOff), {
|
2016-08-23 07:57:54 +00:00
|
|
|
params ["_vehicle"];
|
2021-10-14 15:49:27 +00:00
|
|
|
if (local _vehicle) then {
|
|
|
|
_this call FUNC(cookOff);
|
2016-08-23 07:57:54 +00:00
|
|
|
};
|
2021-10-14 15:49:27 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(cookOffEffect), FUNC(cookOffEffect)] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(smoke), FUNC(smoke)] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(cookOffBox), FUNC(cookOffBox)] call CBA_fnc_addEventHandler;
|
2016-08-23 07:57:54 +00:00
|
|
|
|
2021-10-14 15:49:27 +00:00
|
|
|
[QGVAR(cleanupEffects), {
|
|
|
|
params ["_vehicle", ["_effects", []]];
|
|
|
|
|
|
|
|
_effects = _effects + (_vehicle getVariable [QGVAR(effects), []]);
|
|
|
|
if !(_effects isEqualTo []) then {
|
|
|
|
{ deleteVehicle _x } count _effects;
|
2016-10-28 20:10:40 +00:00
|
|
|
};
|
2021-10-14 15:49:27 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2016-10-28 20:10:40 +00:00
|
|
|
|
2021-10-14 15:49:27 +00:00
|
|
|
GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
2016-07-14 14:16:53 +00:00
|
|
|
|
2016-10-06 20:37:38 +00:00
|
|
|
["ReammoBox_F", "init", {
|
|
|
|
(_this select 0) addEventHandler ["HandleDamage", {
|
2017-12-06 19:13:10 +00:00
|
|
|
if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then {
|
2021-10-14 15:49:27 +00:00
|
|
|
_this call FUNC(handleDamage);
|
2016-10-06 20:37:38 +00:00
|
|
|
};
|
|
|
|
}];
|
|
|
|
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
2016-07-14 14:16:53 +00:00
|
|
|
// secondary explosions
|
2016-08-13 10:12:34 +00:00
|
|
|
["AllVehicles", "killed", {
|
2021-02-23 17:42:15 +00:00
|
|
|
params ["_vehicle", "", "", "_useEffects"];
|
|
|
|
if (
|
|
|
|
_useEffects &&
|
|
|
|
_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]
|
|
|
|
) then {
|
2017-01-23 18:13:02 +00:00
|
|
|
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
2017-01-04 21:35:54 +00:00
|
|
|
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
|
|
|
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
|
2016-08-13 10:12:34 +00:00
|
|
|
};
|
2016-10-06 20:37:38 +00:00
|
|
|
}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler;
|