- Duke (RRRA): Fix potential issue originating from 1bc51a7367 where horizon might have needed adjustment to 0 but wouldn't have done so.

* Previously used to determine whether to apply a horizon adjustment on whether local variable `horiz` was 0 or not (since baseline horizon was 100).
* For no particular reason, initalise `horiz` as FRACUNIT and process if it is not equal to one.
This commit is contained in:
Mitchell Richters 2020-10-15 20:33:28 +11:00
parent db419fd618
commit b1536d8a0b

View file

@ -1714,7 +1714,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
} }
} }
double horiz = 0; double horiz = FRACUNIT;
if (p->TurbCount) if (p->TurbCount)
{ {
if (p->TurbCount <= 1) if (p->TurbCount <= 1)
@ -1756,7 +1756,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
p->VBumpTarget = 0; p->VBumpTarget = 0;
p->moto_bump_fast = 0; p->moto_bump_fast = 0;
} }
if (horiz != 0) if (horiz != FRACUNIT)
{ {
p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16())); p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16()));
} }
@ -2043,7 +2043,7 @@ static void onBoat(int snum, ESyncBits &actions)
} }
} }
double horiz = 0; double horiz = FRACUNIT;
if (p->TurbCount) if (p->TurbCount)
{ {
if (p->TurbCount <= 1) if (p->TurbCount <= 1)
@ -2085,7 +2085,7 @@ static void onBoat(int snum, ESyncBits &actions)
p->VBumpTarget = 0; p->VBumpTarget = 0;
p->moto_bump_fast = 0; p->moto_bump_fast = 0;
} }
if (horiz != 0) if (horiz != FRACUNIT)
{ {
p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16())); p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16()));
} }