mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use eyePos for better position
This commit is contained in:
parent
70b21f6cec
commit
eb02fd7a10
@ -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 {
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user