fnc_checkInsideCCP.sqf 628 B

123456789101112131415161718
  1. params ["_unit"];
  2. private _fnc_check = {
  3. private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2];
  4. (
  5. (lineIntersectsWith [_position, _position vectorAdd [0, 0, 10], _unit]) findIf {
  6. typeOf _x in rd501_medical_ccp_classes || {_x getVariable ["rd501_medical_ccp_inside", false]}
  7. } != -1
  8. )
  9. || {
  10. ((_unit nearObjects 7.5) findIf {
  11. typeOf _x in rd501_medical_ccp_classes || {_x getVariable ["rd501_medical_ccp_inside", false]}
  12. } != -1)
  13. }
  14. };
  15. [[], _fnc_check, _unit, "rd501_medical_ccp_insideCache", 1] call ace_common_fnc_cachedCall;