ACE3/addons/cookoff/functions/fnc_engineFireServer.sqf
johnb432 c44a1e7ea7
Cookoff - Mini-Rewrite (#9758)
* Cook-off improvements

* More changes

* Update fnc_getVehicleAmmo.sqf

* Better engine fire placement

* Update fnc_detonateAmmunition.sqf

* Update XEH_postInit.sqf

* Update fnc_getVehicleAmmo.sqf

* Update events-framework.md

* Various improvements

* Separate effect handling

* Tweaks

* Update XEH_postInit.sqf

* Prevent double ammo detonation

* Fixed objects not being able to cook-off again

* Added incendiary rounds as source of box cookoff

* Converted enable setting to bool

* Fixed brackets

* Update fnc_cookOff.sqf

* Update CfgEden.hpp

* Removed GVAR(enable), added GVAR(enableFire) back

* Update initSettings.inc.sqf

* Update events-framework.md

* Update addons/cookoff/functions/fnc_cookOffEffect.sqf

* Restructured, redid API events

* Fix effect for JIP, minor optimisations

* Removed `cbaSettings_settingChanged`

* Renamed variables, tweaked string table entries

* Update fire damage #9991

* Capitalize comments again

* Fix cookoff for very short durations and fix effect removal being too quick
2024-06-05 12:36:39 -07:00

35 lines
897 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2, johnb43
* Start fire in engine block of a car.
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* Return Value:
* None
*
* Example:
* cursorObject call ace_cookoff_fnc_engineFireServer
*
* Public: No
*/
if (!isServer) exitWith {};
params ["_vehicle"];
// If already smoking, stop
if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {};
_vehicle setVariable [QGVAR(isEngineSmoking), true, true];
// Spawn engine fire effects on all connected machines
private _jipID = [QGVAR(engineFireLocal), [_vehicle, CBA_missionTime + random [ENGINE_FIRE_TIME / 2, ENGINE_FIRE_TIME, ENGINE_FIRE_TIME / 2 * 3]]] call CBA_fnc_globalEventJIP;
[_jipID, _vehicle] call CBA_fnc_removeGlobalEventJIP;
_vehicle setVariable [QGVAR(engineFireJipID), _jipID];
// API
[QGVAR(engineFire), [_vehicle]] call CBA_fnc_globalEvent;