ACE3/addons/cookoff/XEH_postInit.sqf
PabstMirror 4cd3f9fe96
Misc - Cleanup unused namespace vars (#8704)
Co-Authored-By: Serg Vergun <1197314+severgun@users.noreply.github.com>

Co-authored-by: Serg Vergun <1197314+severgun@users.noreply.github.com>
2021-11-26 10:56:41 -06:00

43 lines
1.5 KiB
Plaintext

#include "script_component.hpp"
[QGVAR(engineFire), FUNC(engineFire)] call CBA_fnc_addEventHandler;
[QGVAR(cookOff), {
params ["_vehicle"];
if (local _vehicle) then {
_this call FUNC(cookOff);
};
}] 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;
[QGVAR(cleanupEffects), {
params ["_vehicle", ["_effects", []]];
_effects = _effects + (_vehicle getVariable [QGVAR(effects), []]);
if !(_effects isEqualTo []) then {
{ deleteVehicle _x } count _effects;
};
}] call CBA_fnc_addEventHandler;
["ReammoBox_F", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then {
_this call FUNC(handleDamageBox);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
// secondary explosions
["AllVehicles", "killed", {
params ["_vehicle", "", "", "_useEffects"];
if (
_useEffects &&
_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]
) then {
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
};
}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler;