Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. [true, "Timer start", "sectorTerrainTest"] call ALIVE_fnc_timer;
  2.  
  3. _playerSector = [ALIVE_sectorGrid, "positionToSector", getPos player] call ALIVE_fnc_sectorGrid;
  4. _playerSectorData = [_playerSector, "data"] call ALIVE_fnc_hashGet;
  5. _sortedShorePositions = [_playerSectorData, "terrain", [getPos player,"shore"]] call ALIVE_fnc_sectorDataSort;
  6.  
  7. if(count _sortedShorePositions > 0) then {
  8. _nearestShorePosition = _sortedShorePositions select 0;
  9. [format["shore_%1", random 1000], _nearestShorePosition,"ICON", [0.5,0.5],"COLORWHITE","Shore","mil_dot","FDiagonal",0,0.5] call ALIVE_fnc_createMarkerGlobal;
  10.  
  11. };
  12.  
  13. [false, "Timer ended", "sectorTerrainTest"] call ALIVE_fnc_timer;
  14.  
  15. result:
  16.  
  17. 18:54:04 Timer ended 0.0020752
  18. 18:54:04 Timer start
  19. 18:54:04 Timer ended 0.0219727
  20. 18:54:04 Timer start
  21. 18:54:04 Timer ended 0.0219727
  22. 18:54:04 Timer start
  23. 18:54:04 Timer ended 0.00195313
  24. 18:54:04 Timer start
  25. 18:54:04 Timer ended 0.0220947
  26. 18:54:04 Timer start
  27. 18:54:04 Timer ended 0.00195313
  28. 18:54:04 Timer start
  29. 18:54:04 Timer ended 0.0219727
  30. 18:54:04 Timer start
  31. 18:54:05 Timer ended 0.0200195
  32. 18:54:05 Timer start
  33. 18:54:05 Timer ended 0.00195313
  34. 18:54:05 Timer start
  35. 18:54:05 Timer ended 0.0200195
  36. 18:54:05 Timer start
  37. 18:54:05 Timer ended 0.0198975
  38. 18:54:05 Timer start
  39. 18:54:05 Timer ended 0.019043
  40. 18:54:05 Timer start
  41. 18:54:05 Timer ended 0.00195313
  42. 18:54:05 Timer start
  43. 18:54:05 Timer ended 0.0209961
  44. 18:54:05 Timer start
  45. 18:54:05 Timer ended 0.0200195
  46.  
  47. -----------------------------
  48.  
  49. [true, "Timer start", "sectorTerrainTest"] call ALIVE_fnc_timer;
  50.  
  51. private _dirTo = [_destination,_position] call BIS_fnc_dirTo;
  52.  
  53. private _onWater = [];
  54. private _distanceToCheck = 250;
  55. private _radius = 1500;
  56.  
  57. if !(surfaceIsWater _destination) then {
  58.  
  59. _radius = 250;
  60.  
  61. while {
  62. private _checkPos = _destination getpos [_distanceToCheck,_dirTo];
  63.  
  64. if (surfaceIsWater _checkPos) then {_onWater pushBack _checkPos} else {_onWater = []};
  65.  
  66. count _onWater < 2 && {_distanceToCheck < 10000}
  67. } do {
  68. _distanceToCheck = _distanceToCheck + 250;
  69. };
  70. };
  71.  
  72. private _searchPosition = if (count _onWater >= 2) then {_onwater select 0} else {_destination};
  73. private _shore = [_searchPosition,0,_radius,3,0,0.5,1,[],[[0,0,0]]] call BIS_fnc_findSafePos;
  74.  
  75. [false, "Timer ended", "sectorTerrainTest"] call ALIVE_fnc_timer;
  76.  
  77. result:
  78.  
  79. 18:59:44 Timer ended 0.000976563
  80. 18:59:44 Timer start
  81. 18:59:44 Timer ended 0.000976563
  82. 18:59:44 Timer start
  83. 18:59:44 Timer ended 0.000976563
  84. 18:59:44 Timer start
  85. 18:59:44 Timer ended 0.0200195
  86. 18:59:44 Timer start
  87. 18:59:44 Timer ended 0.000976563
  88. 18:59:44 Timer start
  89. 18:59:44 Timer ended 0.0180664
  90. 18:59:44 Timer start
  91. 18:59:44 Timer ended 0.00195313
  92. 18:59:44 Timer start
  93. 18:59:44 Timer ended 0.0200195
  94. 18:59:44 Timer start
  95. 18:59:44 Timer ended 0
  96. 18:59:44 Timer start
  97. 18:59:44 Timer ended 0.000976563
  98. 18:59:44 Timer start
  99. 18:59:44 Timer ended 0
  100. 18:59:44 Timer start
  101. 18:59:44 Timer ended 0.000976563
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement