Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. /*
  2. File: fn_getBuildingPositions.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Retrieves all 3D-world positions in a building and also restricts
  7. certain positions due to window positioning.
  8. */
  9. private ["_building","_arr","_restricted","_exitLoop","_i"];
  10. _building = _this select 0;
  11. _arr = [];
  12.  
  13. _restricted = switch (typeOf _building) do {
  14. case "Land_i_House_Big_02_V1_F": {[0,1,2,3,4]};
  15. case "Land_i_House_Big_02_V2_F": {[0,1,2,3,4]};
  16. case "Land_i_House_Big_02_V3_F": {[0,1,2,3,4]};
  17. case "Land_i_House_Big_01_V1_F": {[2,3]};
  18. case "Land_i_House_Big_01_V2_F": {[2,3]};
  19. case "Land_i_House_Big_01_V3_F": {[2,3]};
  20. case "Land_i_Stone_HouseSmall_V1_F": {[0,1,3,4]};
  21. case "Land_i_Stone_HouseSmall_V2_F": {[0,1,3,4]};
  22. case "Land_i_Stone_HouseSmall_V3_F": {[0,1,3,4]};
  23. default {[]};
  24. };
  25.  
  26. _i = 0;
  27. _exitLoop = false; //Loops are not fun.
  28. for "_i" from 0 to 1 step 0 do {
  29. if (!(_i in _restricted)) then {
  30. _pos = _building buildingPos _i;
  31. if (_pos isEqualTo [0,0,0]) exitWith {_exitLoop = true;};
  32. _arr pushBack _pos;
  33. };
  34. if (_exitLoop) exitWith {};
  35. _i = _i + 1;
  36. };
  37.  
  38. _arr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement