mirror of
https://github.com/Ghostrider-DbD-/GMS_RC.git
synced 2024-08-30 16:02:11 +00:00
43 lines
987 B
Plaintext
43 lines
987 B
Plaintext
/*
|
|
GMS_fnc_findShoreLocation
|
|
|
|
by Ghostrider [GRG]
|
|
Copyright 2016
|
|
--------------------------
|
|
License
|
|
--------------------------
|
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
|
|
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
*/
|
|
#include "\GMS\Compiles\Init\GMS_defines.hpp"
|
|
private["_mapCenter","_waterPos","_priorUMSpositions","_maxDistance"];
|
|
|
|
private _evaluate = true;
|
|
while {_evaluate} do
|
|
{
|
|
_waterPos = [
|
|
GMS_mapCenter, // center of search area
|
|
2, // min distance to search
|
|
GMS_maxSeaSearchDistance, // max distance to search
|
|
0, // distance to nearest object
|
|
2, // water mode [2 = water only]
|
|
25, // max gradient
|
|
0 // shoreMode [0 = anywhere]
|
|
] call BIS_fnc_findSafePos;
|
|
|
|
if (((getTerrainHeightASL _waterPos) < -4) && (getTerrainHeightASL _waterPos) > -10) then
|
|
{
|
|
_evaluate = false;
|
|
};
|
|
};
|
|
//diag_log format["_findShoreLocation: _waterPos = %1",_waterPos];
|
|
_waterPos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|