DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf
eraser1 e3d11a0aa5 Initial Test Branch Commit
Lots of optimizations...
2016-05-06 22:44:48 -05:00

48 lines
578 B
Plaintext

/*
DMS_fnc_IsNearWater
Original function by WAI
Improved by eraser1
Usage:
[
_position,
_radius
] call DMS_fnc_IsNearWater
*/
if !(params
[
["_position",[],[[]],[2,3]],
["_radius",0,[0]]
])
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