mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
26 lines
485 B
Plaintext
26 lines
485 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 ["_return","_aslPos"];
|
|
|
|
PARAMS_1(_unit);
|
|
_return = false;
|
|
|
|
if ((surfaceIsWater getPos _unit)) then {
|
|
_aslPos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
|
if ((_aslPos select 2) <= 0) then {
|
|
_return = true;
|
|
};
|
|
};
|
|
|
|
_return;
|