Fix terrain LOS check for vehicles with low getPos (#4130)

Fix #4126
This commit is contained in:
PabstMirror 2016-07-21 20:07:54 -05:00 committed by GitHub
parent da9defba3b
commit 7239f3e88c

View File

@ -5,24 +5,24 @@
* Arguments:
* 0: Seeker [Object]
* 1: Target [Object]
*
*
* Return Value:
* Boolean
*/
#include "script_component.hpp"
private["_seeker", "_seekerPos", "_target", "_targetPos", "_return", "_vectorTo", "_searchPos"];
_seeker = _this select 0;
_target = _this select 1;
params ["_seeker", "_target"];
if ((isNil "_seeker") || {isNil "_target"}) exitWith {false};
_targetPos = getPosASL _target;
_seekerPos = getPosASL _seeker;
_return = true;
private _targetPos = getPosASL _target;
private _targetAimPos = aimPos _target;
private _seekerPos = getPosASL _seeker;
private _return = true;
if(!(terrainIntersectASL [ _seekerPos, _targetPos])) then {
if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]})) then {
if(lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then {
_return = false;
_return = false;
};
} else {
_return = false;