DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf
eraser1 687bbfb798 Use config function definitions
Thanks for the tip Zupa!
2015-09-04 22:40:00 -05:00

27 lines
446 B
Plaintext

/*
DMS_fnc_IsNearWater
All credit goes to WAI
Usage:
[
_position,
_radius
] call DMS_fnc_IsNearWater
*/
private["_result","_position","_radius"];
_result = false;
_position = _this select 0;
_radius = _this select 1;
for "_i" from 0 to 359 step 45 do {
_position = [(_position select 0) + (sin(_i)*_radius), (_position select 1) + (cos(_i)*_radius)];
if (surfaceIsWater _position) exitWith {
_result = true;
};
};
_result