Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions addons/fire/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@

if (!isServer) exitWith {};

addMissionEventHandler ["BuildingChanged", {
params ["_pump", "_ruin", "_isRuin"];
if (
!_isRuin // partial destruction
|| {!isNull _ruin} // pump with ruin has endless effects
|| {getNumber (configOf _pump >> "transportFuel") == 0} // getFuelCargo returns 0 for any dead object
) exitWith {};

// while pump going down under terrain, effect can be up to 3m away
private _hasEffectsCode = {_this nearObjects ["#destructioneffects", 3] isNotEqualTo []};
TRACE_2("BuildingChanged",_pump,_pump call _hasEffectsCode);

[QGVAR(addFireSource), [
getPosASL _pump, // pump goes under terrain when destroyed, use position
4 max (boundingBoxReal [_pump, "FireGeometry"] select 2),
8,
QGVAR(wreck) + hashValue _pump,
_hasEffectsCode,
_pump
]] call CBA_fnc_localEvent;
}];

GVAR(fireSources) = createHashMap;

[QGVAR(addFireSource), {
Expand Down
Loading