mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
48 lines
553 B
Plaintext
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
|