diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 4c912e98b4..cedc27cfee 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -115,6 +115,7 @@ PREP(isInBuilding); PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); +PREP(isUnderwater); PREP(letterToCode); PREP(lightIntensityFromObject); PREP(loadPerson); diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index 7c8e2eee21..3b323469fc 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -1,29 +1,19 @@ /* * Author: Glowbal - * Check if unit is underwater + * Check if unit's head is underwater * * Arguments: * 0: Unit * * Return Value: - * if unit is in the water (BOOLEAN) + * If unit's head is underwater * * Public: Yes + * + * Deprecated */ #include "script_component.hpp" -params ["_unit"]; +ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater"); -private "_return"; -_return = false; - -if (surfaceIsWater getPosASL _unit) then { - private "_pos"; - _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); - - if (_pos select 2 < 0) then { - _return = true; - }; -}; - -_return +_this call FUNC(isUnderwater) diff --git a/addons/common/functions/fnc_isUnderwater.sqf b/addons/common/functions/fnc_isUnderwater.sqf new file mode 100644 index 0000000000..d2f399b770 --- /dev/null +++ b/addons/common/functions/fnc_isUnderwater.sqf @@ -0,0 +1,29 @@ +/* + * Author: Glowbal + * Check if unit's head is underwater + * + * Arguments: + * 0: Unit + * + * Return Value: + * If unit's head is underwater + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +private "_return"; +_return = false; + +if (surfaceIsWater getPosASL _unit) then { + private "_pos"; + _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); + + if (_pos select 2 < 0) then { + _return = true; + }; +}; + +_return