- add all the horizon values before converting into true pitch inside sethorizon().

This commit is contained in:
Mitchell Richters 2020-08-03 22:13:10 +10:00
parent 573cb363ae
commit 19e4393a4f

View file

@ -961,7 +961,7 @@ void sethorizon(int snum, int sb_snum, double factor, bool frominput, fixed_t ad
auto p = &ps[snum];
// Calculate adjustment as true pitch (Fixed point math really sucks...)
double horizAngle = atan2(p->q16horiz - F16(100), F16(128)) * (512. / pi::pi()) + (factor * p->horizAdjust) + (adjustment / 65536.);
double horizAngle = atan2((p->q16horiz + ((factor * p->horizAdjust) * 65536) + adjustment) - F16(100), F16(128)) * (512. / pi::pi());
if (p->return_to_center > 0 && (sb_snum & (SKB_LOOK_UP | SKB_LOOK_DOWN)) == 0) // only snap back if no relevant button is pressed.
{