Fix mortar changes for laser shootRay changes

Ref #4478
This commit is contained in:
PabstMirror 2016-10-12 18:44:49 -05:00 committed by Glowbal
parent fe35e64696
commit 6fce923783

View File

@ -86,10 +86,10 @@ if (_lastFireMode != -1) then {
// With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground // With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground
private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]); private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]);
private _testSeekerDir = _testSeekerPosASL vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1])); private _testSeekerDir = _testSeekerPosASL vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1]));
private _laserRange = [_testSeekerPosASL, _testSeekerDir, _mortarVeh] call EFUNC(laser,shootRay); private _testPoint = _testSeekerPosASL vectorAdd (_testSeekerDir vectorMultiply viewDistance);
_laserRange params ["", ["_rayDistance", -5]]; // ToDo: move shootRay to common if ((terrainIntersectASL [_testSeekerPosASL, _testPoint]) || {lineIntersects [_testSeekerPosASL, _testPoint]}) then {
TRACE_2("",_rayDistance,viewDistance); _useRealWeaponDir = false; // If we are not looking at infinity (based on viewDistance)
_useRealWeaponDir = _rayDistance > viewDistance; // If we are looking at infinity (based on viewDistance) };
}; };
if (_useRealWeaponDir) then { if (_useRealWeaponDir) then {