From 6181616cc36501319ededbf0e791155bbaafdf66 Mon Sep 17 00:00:00 2001 From: Crowdedlight Date: Sat, 24 Jun 2023 04:34:31 +0200 Subject: [PATCH] Fire - Fix fire spread to invincible units and not being able to be put on fire by proximity if multiple units are on fire (#8632) * fire do not propagate to close unit if allowDamage is disable don that unit * change burnCounter so it works with multiple instances of fires * fixed exiting burning not resetting burn counter * changed !isEqualTo to isNotEqualTo * changed !isEqualTo to isNotEqualTo * lazy eval, respect old allowDamage variable --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: Salluci --- addons/fire/XEH_postInit.sqf | 1 + addons/fire/functions/fnc_burn.sqf | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 655b55af19..125cb59140 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -35,3 +35,4 @@ GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate; }; }] call CBA_fnc_addEventHandler; + diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index e4c14e3d20..31da540fc2 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -160,8 +160,8 @@ if (_isBurning) exitWith {}; [QGVAR(burn), [ace_player, _intensity * (7 / 8), _instigator]] call CBA_fnc_globalEvent; }; } else { - if ((ace_player isKindOf "Man") && {_unit isNotEqualTo ace_player}) then { - private _burnCounter = ace_player getVariable [QGVAR(burnCounter), 0]; + if ((ace_player isKindOf "Man") && {_unit isNotEqualTo ace_player} && {isDamageAllowed ace_player && {ace_player getVariable [QEGVAR(medical,allowDamage), true]}}) then { + private _burnCounter = _unit getVariable [QGVAR(burnCounter), 0]; if (_distanceToUnit < BURN_PROPOGATE_DISTANCE) then { if (_burnCounter < BURN_PROPOGATE_COUNTER_MAX) then { _burnCounter = _burnCounter + 1; @@ -171,7 +171,7 @@ if (_isBurning) exitWith {}; } else { _burnCounter = 0; }; - ace_player setVariable [QGVAR(burnCounter), _burnCounter]; + _unit setVariable [QGVAR(burnCounter), _burnCounter]; }; }; }; @@ -324,6 +324,7 @@ if (_isBurning) exitWith {}; }; }; _unit setVariable [QGVAR(burning), false]; + _unit setVariable [QGVAR(burnCounter), 0]; }, { // run condition true