Fixes left/right issue.

This commit is contained in:
jaynus 2015-04-08 11:27:30 -07:00
parent bc7943d729
commit 3946ee32d2

View File

@ -23,6 +23,7 @@ if(!isNil "_seekerTargetPos") then {
_minDeflection = _flightParams select 0; _minDeflection = _flightParams select 0;
_maxDeflection = _flightParams select 1; _maxDeflection = _flightParams select 1;
_incDeflection = _flightParams select 2;
_yVec = vectorDir _projectile; _yVec = vectorDir _projectile;
_zVec = vectorUp _projectile; _zVec = vectorUp _projectile;
@ -38,14 +39,14 @@ if(!isNil "_seekerTargetPos") then {
_pitch = 0; _pitch = 0;
if((_targetVectorSeeker select 0) < 0) then { if((_targetVectorSeeker select 0) < 0) then {
_yaw = - ( (_minDeflection max ((_targetVector select 0) min _maxDeflection) ) ); _yaw = - ( (_minDeflection max (abs(_targetVector select 0) min _maxDeflection) ) );
} else { } else {
if((_targetVectorSeeker select 0) > 0) then { if((_targetVectorSeeker select 0) > 0) then {
_yaw = ( (_minDeflection max ((_targetVector select 0) min _maxDeflection) ) ); _yaw = ( (_minDeflection max ((_targetVector select 0) min _maxDeflection) ) );
}; };
}; };
if((_targetVectorSeeker select 2) < 0) then { if((_targetVectorSeeker select 2) < 0) then {
_pitch = - ( (_minDeflection max ((_targetVector select 2) min _maxDeflection) ) ); _pitch = - ( (_minDeflection max (abs(_targetVector select 2) min _maxDeflection) ) );
} else { } else {
if((_targetVectorSeeker select 2) > 0) then { if((_targetVectorSeeker select 2) > 0) then {
_pitch = ( (_minDeflection max ((_targetVector select 2) min _maxDeflection) ) ); _pitch = ( (_minDeflection max ((_targetVector select 2) min _maxDeflection) ) );