diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index c920e7942c..364a42c14c 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -24,16 +24,20 @@ _addHeight = [0,0,0]; // Always climb an arc on initial launch if we are close to the round if( ((ASLtoATL _projectilePos) select 2) < 20 && _distanceToShooter < 50) then { _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; -}; - -// If we are below the target, increase the climbing arc -if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { - _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02]; +} else { + // If we are below the target, increase the climbing arc + if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { + _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; + }; }; // Handle arcing terminal low for high decent if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then { - _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.25]; + _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; +} else { + if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then { + _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02]; + }; }; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 6d4d643d78..3786f28469 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -72,8 +72,9 @@ if(!isNil "_seekerTargetPos") then { if(accTime > 0) then { private["_adjustTime", "_outVector", "_vectorTo"]; _adjustTime = 1/accTime; - _adjustTime = _adjustTime * (_runtimeDelta / 0.01); - TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / 0.1)); + _adjustTime = _adjustTime * ( 1 / (_runtimeDelta / 0.1)); + TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, ( 1 / (_runtimeDelta / 0.1)) ); + _outVector = [_projectile, [_xVec, _yVec, _zVec], [_yaw, _adjustTime, _pitch]] call FUNC(translateToModelSpace); _vectorTo = _projectilePos vectorFromTo _outVector;