- Duke/RR; Don't lose the precision of p->MotoSpeed when calculating p->VBumpTarget.

This commit is contained in:
Mitchell Richters 2021-12-06 22:27:02 +11:00 committed by Mitch Richters
parent 7f1b8402d1
commit af96180123
3 changed files with 10 additions and 8 deletions

View file

@ -1721,7 +1721,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
if (p->MotoSpeed != 0 && p->on_ground == 1)
{
if (!p->VBumpNow && (krand() & 3) == 2)
p->VBumpTarget = short((p->MotoSpeed / 16.) * ((krand() & 7) - 4));
p->VBumpTarget = p->MotoSpeed * (1. / 16.) * ((krand() & 7) - 4);
if (p->vehTurnLeft || p->moto_drink < 0)
{
@ -1757,14 +1757,14 @@ static void onMotorcycle(int snum, ESyncBits &actions)
p->VBumpNow += p->moto_bump_fast ? 6 : 1;
if (p->VBumpTarget < p->VBumpNow)
p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3.;
horiz = p->VBumpNow * (1. / 3.);
}
else if (p->VBumpTarget < p->VBumpNow)
{
p->VBumpNow -= p->moto_bump_fast ? 6 : 1;
if (p->VBumpTarget > p->VBumpNow)
p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3.;
horiz = p->VBumpNow * (1. / 3.);
}
else
{
@ -1991,7 +1991,7 @@ static void onBoat(int snum, ESyncBits &actions)
if (p->MotoSpeed != 0 && p->on_ground == 1)
{
if (!p->VBumpNow && (krand() & 15) == 14)
p->VBumpTarget = short((p->MotoSpeed / 16.) * ((krand() & 3) - 2));
p->VBumpTarget = p->MotoSpeed * (1. / 16.) * ((krand() & 3) - 2);
if (p->vehTurnLeft && p->moto_drink < 0)
{
@ -2025,14 +2025,14 @@ static void onBoat(int snum, ESyncBits &actions)
p->VBumpNow += p->moto_bump_fast ? 6 : 1;
if (p->VBumpTarget < p->VBumpNow)
p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3.;
horiz = p->VBumpNow * (1. / 3.);
}
else if (p->VBumpTarget < p->VBumpNow)
{
p->VBumpNow -= p->moto_bump_fast ? 6 : 1;
if (p->VBumpTarget > p->VBumpNow)
p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3.;
horiz = p->VBumpNow * (1. / 3.);
}
else
{

View file

@ -283,7 +283,8 @@ struct player_struct
short MamaEnd; // raat609
short moto_drink;
float TiltStatus, oTiltStatus;
short VBumpNow, VBumpTarget, TurbCount;
double VBumpNow, VBumpTarget;
short TurbCount;
short drug_stat[3]; // raat5f1..5
uint8_t DrugMode, lotag800kill;
uint8_t sea_sick_stat; // raat5dd

View file

@ -229,7 +229,8 @@ struct DukePlayer
native int16 MamaEnd; // raat609
native int16 moto_drink;
native float TiltStatus, oTiltStatus;
native int16 VBumpNow, VBumpTarget, TurbCount;
native double VBumpNow, VBumpTarget;
native int16 TurbCount;
native int16 drug_stat[3]; // raat5f1..5
native uint8 DrugMode, lotag800kill;
native uint8 sea_sick_stat; // raat5dd