diff --git a/addons/cookoff/functions/fnc_handleDamageBox.sqf b/addons/cookoff/functions/fnc_handleDamageBox.sqf index 2d55db0fd02..e78f2c94b8b 100644 --- a/addons/cookoff/functions/fnc_handleDamageBox.sqf +++ b/addons/cookoff/functions/fnc_handleDamageBox.sqf @@ -32,30 +32,12 @@ if !(_hitPoint == "" && {_damage > 0.5}) exitWith {}; // "" means structural dam private _ammoConfig = _ammo call CBA_fnc_getObjectConfig; // Catch fire when hit by an explosive or incendiary round -if ((getNumber (_ammoConfig >> "explosive") >= 0.5) || {getNumber (_ammoConfig >> QEGVAR(vehicle_damage,incendiary)) > random 1}) then { +if ( + (getNumber (_ammoConfig >> "explosive") >= 0.5) || + {getNumber (_ammoConfig >> QEGVAR(vehicle_damage,incendiary)) > random 1} || + {_damage * 0.05 > random 1 && {_ammo getShotInfo 4}} // There is a small chance of cooking a box off if it's shot by tracer ammo +) then { [QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent; -} else { - // There is a small chance of cooking a box off if it's shot by tracer ammo - if (random 1 >= _damage * 0.05) exitWith {}; - - // Need magazine to check for tracers - private _magazine = if (_source == _instigator) then { - currentMagazine _source - } else { - _source currentMagazineTurret (_source unitTurret _instigator) - }; - - private _configMagazine = configFile >> "CfgMagazines" >> _magazine; - - // Magazine could have changed during flight time (just ignore if so) - if (getText (_configMagazine >> "ammo") == _ammo) then { - // If magazine's tracer density is high enough then low chance for cook off - private _tracers = getNumber (_configMagazine >> "tracersEvery"); - - if (_tracers >= 1 && {_tracers <= 4}) then { - [QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent; - }; - }; }; // Prevent destruction, let cook-off handle it if necessary