From 46e58177dba03fad0fdf78db85ef090ec8d3f4e8 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Apr 2024 17:39:25 +0200 Subject: [PATCH] Make wrecks cause fire damage --- addons/fire/XEH_postInit.sqf | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index ed808d6946..3dcff3b07c 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -14,13 +14,29 @@ }; }] call CBA_fnc_addEventHandler; -if (!isServer) exitWith {}; - ["CBA_settingsInitialized", { TRACE_1("settingsInit",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; + // Make burning wrecks into fire sources + ["AllVehicles", "Killed", { + params ["_vehicle", "", "", "_useEffects"]; + + if (_useEffects) then { + [QGVAR(addFireSource), [ + _vehicle, + (boundingBoxReal [_vehicle, "FireGeometry"]) select 2, + BURN_MAX_INTENSITY, + QGVAR(wreck) + hashValue _vehicle, + {!isNull _this && {_this getEntityInfo 13}}, + _vehicle + ]] call CBA_fnc_serverEvent; + }; + }, true, ["CAManBase", "StaticWeapon"], true] call CBA_fnc_addClassEventHandler; + + if (!isServer) exitWith {}; + GVAR(fireSources) = createHashMap; [QGVAR(addFireSource), {