mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cookOff - Fix: Disable ammunition cookoff and turret effect when skipping destruction effects (#8122)
* Disable ammunition cookoff and turret effect when skiping destruction effects * Improve readability
This commit is contained in:
parent
61e8ae3c8b
commit
d00e7a17a1
@ -73,8 +73,11 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
||||
|
||||
// secondary explosions
|
||||
["AllVehicles", "killed", {
|
||||
params ["_vehicle"];
|
||||
if (_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
|
||||
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);
|
||||
@ -83,9 +86,13 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
||||
|
||||
// blow off turret effect
|
||||
["Tank", "killed", {
|
||||
if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then {
|
||||
params ["_vehicle", "", "", "_useEffects"];
|
||||
if (
|
||||
_useEffects &&
|
||||
_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]
|
||||
) then {
|
||||
if (random 1 < 0.15) then {
|
||||
(_this select 0) call FUNC(blowOffTurret);
|
||||
_vehicle call FUNC(blowOffTurret);
|
||||
};
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user