search for door in geometry lod (lineintersectssurface)

This commit is contained in:
commy2 2015-09-28 18:45:10 +02:00
parent 5a3a32f236
commit 6f64fcd0fb
2 changed files with 5 additions and 7 deletions

View File

@ -19,18 +19,16 @@
params ["_distance"];
private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"];
private ["_position0", "_position1", "_intersections", "_house", "_door"];
_position0 = positionCameraToWorld [0, 0, 0];
_position1 = positionCameraToWorld [0, 0, _distance];
_intersections = lineIntersectsWith [AGLToASL _position0, AGLToASL _position1, objNull, objNull, true]; // @todo LIS
_intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"];
_count = count _intersections;
if (_intersections isEqualTo []) exitWith {[objNull, ""]};
if (_count == 0) exitWith {[objNull, ""]};
_house = _intersections select (_count - 1);
_house = _intersections select 0 select 2;
// shithouse is bugged
if (typeOf _house == "") exitWith {[objNull, ""]};

View File

@ -19,7 +19,7 @@
params ["_unit", "_team"];
// make sure correct team is set on JIP
_unit setVariable [QGVAR(assignedFireTeam), _team, true]; // @todo reset variable for Respawn+JIP - bug
_unit setVariable [QGVAR(assignedFireTeam), _team, true];
// join fire team on every machine in that group
["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent);