Add support for disabling cookoff for individual vehicles

This commit is contained in:
Glowbal 2016-09-12 19:09:11 +02:00
parent b8948ec296
commit 48a198fea4

View File

@ -22,7 +22,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
}; };
_vehicle addEventHandler ["HandleDamage", { _vehicle addEventHandler ["HandleDamage", {
if (GVAR(enable)) then { if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then {
["tank", _this] call FUNC(handleDamage); ["tank", _this] call FUNC(handleDamage);
}; };
}]; }];
@ -30,7 +30,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
["Wheeled_APC_F", "init", { ["Wheeled_APC_F", "init", {
(_this select 0) addEventHandler ["HandleDamage", { (_this select 0) addEventHandler ["HandleDamage", {
if (GVAR(enable)) then { if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then {
["tank", _this] call FUNC(handleDamage); ["tank", _this] call FUNC(handleDamage);
}; };
}]; }];
@ -38,7 +38,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
["Car", "init", { ["Car", "init", {
(_this select 0) addEventHandler ["HandleDamage", { (_this select 0) addEventHandler ["HandleDamage", {
if (GVAR(enable)) then { if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then {
["car", _this] call FUNC(handleDamage); ["car", _this] call FUNC(handleDamage);
}; };
}]; }];
@ -46,14 +46,14 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
// secondary explosions // secondary explosions
["AllVehicles", "killed", { ["AllVehicles", "killed", {
if (GVAR(enable)) then { if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then {
(_this select 0) call FUNC(secondaryExplosions); (_this select 0) call FUNC(secondaryExplosions);
}; };
}, nil, ["Man"]] call CBA_fnc_addClassEventHandler; }, nil, ["Man"]] call CBA_fnc_addClassEventHandler;
// blow off turret effect // blow off turret effect
["Tank", "killed", { ["Tank", "killed", {
if (GVAR(enable)) then { if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then {
(_this select 0) call FUNC(blowOffTurret); (_this select 0) call FUNC(blowOffTurret);
}; };
}] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addClassEventHandler;