From eb02fd7a109c7f3a65346ac2dda6357584669b4c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 13 Feb 2024 01:13:45 +0100 Subject: [PATCH] Use eyePos for better position --- addons/fire/functions/fnc_burn.sqf | 6 +++--- addons/fire/functions/fnc_burnSimulation.sqf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index ed9883cf8f..511133bfd0 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -36,10 +36,10 @@ if (getNumber (configOf _unit >> "isPlayableLogic") == 1 || {!(_unit isKindOf "C // If unit is invulnerable, don't burn the unit if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {}; -private _unitPos = getPosASL _unit; +private _eyePos = eyePos _unit; -// Check if unit is in water -if (surfaceIsWater _unitPos && {(_unitPos select 2) < 1}) exitWith {}; +// Check if unit is mostly submerged in water +if (surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}) exitWith {}; // If unit is already burning, update intensity, but don't add another PFH if (_unit call FUNC(isBurning)) exitWith { diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index e077286b12..27f9957ad7 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -40,7 +40,7 @@ _unit setVariable [QGVAR(burnCounter), nil]; if ( !(_unit call FUNC(isBurning)) || {!(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]})} || - {private _unitPos = getPosASL _unit; surfaceIsWater _unitPos && {(_unitPos select 2) < 1}} + {private _eyePos = eyePos _unit; surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}} ) exitWith { // Remove global effects and simulation {