Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. params [
  2. ["_target", cursorObject,[objNull]],
  3. ["_begPos", [], [[]] ],
  4. ["_endPos", [], [[]] ]
  5. ];
  6.  
  7. if (_begPos isEqualTo []) then {
  8. _begPos = (positionCameraToWorld [0,0,0]);
  9. };
  10. if (_endPos isEqualTo []) then {
  11. _endPos = ((_begPos vectorAdd ((getCameraViewDirection player) vectorMultiply 5)));
  12. };
  13.  
  14. private _return = "";
  15. private _intersections = ([_target, "GEOM"] intersect [_begPos, _endPos]); //CTD DANGER
  16.  
  17. if (!(_intersections isEqualTo [])) then {
  18. //direct Intersection found
  19. {
  20. private _selName = (_x select 0);
  21. if (
  22. ((_selName find "door_") > -1)
  23. || ((_selName find "hatch") > -1)
  24. || ((_selName find "dvere") > -1)
  25. || ((_selName find "gate_") > -1)
  26. || ((_selName find "doorr") > -1)
  27. || ((_selName find "doorl") > -1)
  28. || ((_selName find "frontdoor") > -1)
  29.  
  30. ) exitWith {
  31. _return = _selName;
  32. };
  33. } forEach _intersections;
  34. };
  35.  
  36. _return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement