From b02a67605c835f15bd152e8e72387a988837b414 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 9 Feb 2016 00:19:18 -0300 Subject: [PATCH] Revert to normal testing for units on foot --- addons/nametags/functions/fnc_onDraw3d.sqf | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index bcbf44c36b..3bb97dba8c 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -106,16 +106,24 @@ if (_enabledTagsNearby) then { // Find valid targets and cache them private _targets = [[], { private _nearMen = _camPosAGL nearObjects ["CAManBase", _maxDistance + 7]; - if (vehicle ACE_player != ACE_player) then { - _nearMen = _nearMen + crew vehicle ACE_player; - }; - _nearMen select { + _nearMen = _nearMen select { _x != ACE_player && {(side group _x) == (side group ACE_player)} && {GVAR(showNamesForAI) || {[_x] call EFUNC(common,isPlayer)}} && - {lineIntersectsSurfaces [_camPosASL, eyePos _x, ACE_player, _x, true, 1, "GEOM", "NONE"] isEqualTo []} && + {lineIntersectsSurfaces [_camPosASL, eyePos _x, ACE_player, _x] isEqualTo []} && {!isObjectHidden _x} - } + }; + private _crewMen = []; + if (vehicle ACE_player != ACE_player) then { + _crewMen = (crew vehicle ACE_player) select { + _x != ACE_player && + {(side group _x) == (side group ACE_player)} && + {GVAR(showNamesForAI) || {[_x] call EFUNC(common,isPlayer)}} && + {lineIntersectsSurfaces [_camPosASL, eyePos _x, ACE_player, _x, true, 1, "GEOM", "NONE"] isEqualTo []} && + {!isObjectHidden _x} + }; + }; + (_nearMen + _crewMen) }, missionNamespace, QGVAR(nearMen), 0.5] call EFUNC(common,cachedCall); {