From 3744b980f49128946e21aed055a5d2bbbec6f778 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 02:14:06 -0500 Subject: [PATCH] Javelin - Verify player has LOS to cursorTarget Fix #3668 --- addons/javelin/functions/fnc_onOpticDraw.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index f561806eaa..4bf80641e3 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -99,7 +99,10 @@ if (_range > 50 && {_range < 2500}) then { }; if (isNull _newTarget) then { - _newTarget = cursorTarget; + private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + _newTarget = cursorTarget; + }; }; // Create constants