- Fix RRRA bike/boat angle adjustments following changes in f343bd8d5e.

* Because we're wrapping a negative number around to be unsigned, we need to do that after we've done our bit-shift operations.
This commit is contained in:
Mitchell Richters 2021-04-11 18:34:07 +10:00
parent f343bd8d5e
commit e959226914
1 changed files with 4 additions and 4 deletions

View File

@ -1773,7 +1773,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->vehTurnLeft || p->vehTurnRight))
{
velAdjustment = p->vehTurnLeft ? -10 : 10;
auto angAdjustment = buildang(velAdjustment < 0 ? 350 : -350);
auto angAdjustment = (velAdjustment < 0 ? 350 : -350) << BAMBITS;
if (p->moto_on_mud || p->moto_on_oil || !p->NotOnWater)
{
@ -1811,7 +1811,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
p->posxv += currSpeed * bcos(velAdjustment * -51 + p->angle.ang.asbuild(), 4);
p->posyv += currSpeed * bsin(velAdjustment * -51 + p->angle.ang.asbuild(), 4);
p->angle.addadjustment(getincanglebam(p->angle.ang, p->angle.ang - angAdjustment));
p->angle.addadjustment(getincanglebam(p->angle.ang, p->angle.ang - bamang(angAdjustment)));
}
else if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->moto_on_mud || p->moto_on_oil))
{
@ -2040,7 +2040,7 @@ static void onBoat(int snum, ESyncBits &actions)
{
int currSpeed = p->MotoSpeed * 4.;
short velAdjustment = p->vehTurnLeft ? -10 : 10;
auto angAdjustment = buildang(velAdjustment < 0 ? 350 : -350);
auto angAdjustment = (velAdjustment < 0 ? 350 : -350) << BAMBITS;
if (p->moto_do_bump)
{
@ -2055,7 +2055,7 @@ static void onBoat(int snum, ESyncBits &actions)
p->posxv += currSpeed * bcos(velAdjustment * -51 + p->angle.ang.asbuild(), 4);
p->posyv += currSpeed * bsin(velAdjustment * -51 + p->angle.ang.asbuild(), 4);
p->angle.addadjustment(getincanglebam(p->angle.ang, p->angle.ang - angAdjustment));
p->angle.addadjustment(getincanglebam(p->angle.ang, p->angle.ang - bamang(angAdjustment)));
}
if (p->NotOnWater && p->MotoSpeed > 50)
p->MotoSpeed -= (p->MotoSpeed / 2.);