ACE3/addons/common/functions/fnc_inWater.sqf
Glowbal 13c2127574 Clean up of old CSE code
Removed all _F suffixes
Reorganized the RPEP list.
Removed unnecessary functions.
2015-02-14 20:29:07 +01:00

22 lines
490 B
Plaintext

/**
* fn_inWater_f.sqf
* @Descr: Check if unit is underwater
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: BOOL True if unit is in the water
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_return","_aslPos"];
_unit = _this select 0;
_return = false;
if ((surfaceIsWater getPos _unit)) then {
_aslPos = _unit modelToWorld (_unit selectionPosition "head");
if ((_aslPos select 2) <= 0) then {
_return = true;
};
};
_return;