Use eyePos for better position

This commit is contained in:
johnb432 2024-02-13 01:13:45 +01:00
parent 70b21f6cec
commit eb02fd7a10
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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
{