2015-09-05 03:40:00 +00:00
|
|
|
/*
|
|
|
|
DMS_fnc_IsNearWater
|
2015-09-10 22:48:56 +00:00
|
|
|
Original function by WAI
|
|
|
|
Improved by eraser1
|
2015-09-05 03:40:00 +00:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
[
|
|
|
|
_position,
|
|
|
|
_radius
|
|
|
|
] call DMS_fnc_IsNearWater
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-08-28 08:38:46 +00:00
|
|
|
private["_result","_position","_radius"];
|
|
|
|
|
|
|
|
_result = false;
|
|
|
|
_position = _this select 0;
|
|
|
|
_radius = _this select 1;
|
|
|
|
|
2015-09-10 22:48:56 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
for "_i" from 0 to 359 step 45 do
|
|
|
|
{
|
|
|
|
if (surfaceIsWater ([_position,_radius,_i] call DMS_fnc_SelectOffsetPos)) then
|
|
|
|
{
|
|
|
|
throw true;
|
|
|
|
};
|
2015-08-28 08:38:46 +00:00
|
|
|
};
|
2015-09-10 22:48:56 +00:00
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
_result = true;
|
2015-08-28 08:38:46 +00:00
|
|
|
};
|
2015-08-30 00:33:32 +00:00
|
|
|
|
2015-08-28 08:38:46 +00:00
|
|
|
_result
|