DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf
2016-06-20 16:12:06 -05:00

48 lines
553 B
Plaintext

/*
DMS_fnc_IsNearWater
Original function by WAI
Improved by eraser1
Usage:
[
_position,
_radius
] call DMS_fnc_IsNearWater
*/
if !(params
[
"_position",
"_radius"
])
exitWith
{
diag_log format["DMS ERROR :: Calling DMS_fnc_IsNearWater with invalid parameters: %1",_this];
false
};
private _result = false;
try
{
if (surfaceIsWater _position) then
{
throw true;
};
for "_i" from 0 to 359 step 45 do
{
if (surfaceIsWater (_position getPos [_radius,_i])) then
{
throw true;
};
};
}
catch
{
_result = true;
};
_result