Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [true, "Timer start", "sectorTerrainTest"] call ALIVE_fnc_timer;
- _playerSector = [ALIVE_sectorGrid, "positionToSector", getPos player] call ALIVE_fnc_sectorGrid;
- _playerSectorData = [_playerSector, "data"] call ALIVE_fnc_hashGet;
- _sortedShorePositions = [_playerSectorData, "terrain", [getPos player,"shore"]] call ALIVE_fnc_sectorDataSort;
- if(count _sortedShorePositions > 0) then {
- _nearestShorePosition = _sortedShorePositions select 0;
- [format["shore_%1", random 1000], _nearestShorePosition,"ICON", [0.5,0.5],"COLORWHITE","Shore","mil_dot","FDiagonal",0,0.5] call ALIVE_fnc_createMarkerGlobal;
- };
- [false, "Timer ended", "sectorTerrainTest"] call ALIVE_fnc_timer;
- result:
- 18:54:04 Timer ended 0.0020752
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.0219727
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.0219727
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.00195313
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.0220947
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.00195313
- 18:54:04 Timer start
- 18:54:04 Timer ended 0.0219727
- 18:54:04 Timer start
- 18:54:05 Timer ended 0.0200195
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.00195313
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.0200195
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.0198975
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.019043
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.00195313
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.0209961
- 18:54:05 Timer start
- 18:54:05 Timer ended 0.0200195
- -----------------------------
- [true, "Timer start", "sectorTerrainTest"] call ALIVE_fnc_timer;
- private _dirTo = [_destination,_position] call BIS_fnc_dirTo;
- private _onWater = [];
- private _distanceToCheck = 250;
- private _radius = 1500;
- if !(surfaceIsWater _destination) then {
- _radius = 250;
- while {
- private _checkPos = _destination getpos [_distanceToCheck,_dirTo];
- if (surfaceIsWater _checkPos) then {_onWater pushBack _checkPos} else {_onWater = []};
- count _onWater < 2 && {_distanceToCheck < 10000}
- } do {
- _distanceToCheck = _distanceToCheck + 250;
- };
- };
- private _searchPosition = if (count _onWater >= 2) then {_onwater select 0} else {_destination};
- private _shore = [_searchPosition,0,_radius,3,0,0.5,1,[],[[0,0,0]]] call BIS_fnc_findSafePos;
- [false, "Timer ended", "sectorTerrainTest"] call ALIVE_fnc_timer;
- result:
- 18:59:44 Timer ended 0.000976563
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.000976563
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.000976563
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.0200195
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.000976563
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.0180664
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.00195313
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.0200195
- 18:59:44 Timer start
- 18:59:44 Timer ended 0
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.000976563
- 18:59:44 Timer start
- 18:59:44 Timer ended 0
- 18:59:44 Timer start
- 18:59:44 Timer ended 0.000976563
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement