diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 38b0d248bbc..fa842c06409 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -96,7 +96,7 @@ if (_smokeDelayEnabled) then { _fireSource = selectRandom _positions; }; - [QGVAR(cookOffEffect), [_vehicle, true, _ring, _time, _fireSource]] call CBA_fnc_globalEvent; + [QGVAR(cookOffEffect), [_vehicle, true, _ring, _time, _fireSource, _intensity]] call CBA_fnc_globalEvent; _intensity = _intensity - (0.5 max random 1); _vehicle setVariable [QGVAR(intensity), _intensity]; diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf index 8a6ea37d991..23a9b13ae02 100644 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ b/addons/cookoff/functions/fnc_cookOffEffect.sqf @@ -9,6 +9,7 @@ * 2: Spawn fire ring * 3: How long effect will last (Max 20 seconds) * 4: What selection will fire originate from + * 5: Cookoff intensity value * * Return Value: * None @@ -19,7 +20,7 @@ * Public: No */ -params ["_obj", "_jet", "_ring", "_time", "_fireSelection"]; +params ["_obj", "_jet", "_ring", "_time", "_fireSelection", "_intensity"]; private _light = "#lightpoint" createVehicleLocal [0,0,0]; _light setLightBrightness 5; _light setLightAmbient [0.8, 0.6, 0.2]; @@ -43,7 +44,7 @@ if (isServer) then { [{ params ["_args", "_pfh"]; - _args params ["_obj", "_jet", "_ring", "_time", "_startTime", "_light", "_fireSelection", "_sound"]; + _args params ["_obj", "_jet", "_ring", "_time", "_startTime", "_light", "_fireSelection", "_sound", "_intensity"]; private _elapsedTime = CBA_missionTime - _startTime; if (_elapsedTime >= _time) exitWith { deleteVehicle _light; @@ -185,5 +186,14 @@ if (isServer) then { [2 + random 1], 1, 0, "", "", _obj ]; }; -}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound]] call cba_fnc_addPerFrameHandler; + + (getVehicleTIPars _obj) params ["_tiEngine", "_tiWheels", "_tiWeapon"]; + _obj setVehicleTIPars [ + // formula is designed to have the temperature ramp up quickly and then level out + (_tiEngine + (_intensity * 0.01))/1.005, + (_tiWheels + (_intensity * 0.004))/1.002, // wheels//tracks are further away from burning parts + (_tiWeapon + (_intensity * 0.01))/1.005 + ]; + +}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound, _intensity]] call CBA_fnc_addPerFrameHandler;