- Duke (RR): Avoid integer truncation when dividing p->VBumpNow.

This commit is contained in:
Mitchell Richters 2020-10-15 10:27:08 +11:00
parent 1bc51a7367
commit e4af4f28ce

View file

@ -1718,7 +1718,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
} }
} }
int horiz = 0; double horiz = 0;
if (p->TurbCount) if (p->TurbCount)
{ {
if (p->TurbCount <= 1) if (p->TurbCount <= 1)
@ -1743,7 +1743,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
p->VBumpNow++; p->VBumpNow++;
if (p->VBumpTarget < p->VBumpNow) if (p->VBumpTarget < p->VBumpNow)
p->VBumpNow = p->VBumpTarget; p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3; horiz = p->VBumpNow / 3.;
} }
else if (p->VBumpTarget < p->VBumpNow) else if (p->VBumpTarget < p->VBumpNow)
{ {
@ -1753,7 +1753,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
p->VBumpNow--; p->VBumpNow--;
if (p->VBumpTarget > p->VBumpNow) if (p->VBumpTarget > p->VBumpNow)
p->VBumpNow = p->VBumpTarget; p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3; horiz = p->VBumpNow / 3.;
} }
else else
{ {
@ -2047,7 +2047,7 @@ static void onBoat(int snum, ESyncBits &actions)
} }
} }
int horiz = 0; double horiz = 0;
if (p->TurbCount) if (p->TurbCount)
{ {
if (p->TurbCount <= 1) if (p->TurbCount <= 1)
@ -2072,7 +2072,7 @@ static void onBoat(int snum, ESyncBits &actions)
p->VBumpNow++; p->VBumpNow++;
if (p->VBumpTarget < p->VBumpNow) if (p->VBumpTarget < p->VBumpNow)
p->VBumpNow = p->VBumpTarget; p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3; horiz = p->VBumpNow / 3.;
} }
else if (p->VBumpTarget < p->VBumpNow) else if (p->VBumpTarget < p->VBumpNow)
{ {
@ -2082,7 +2082,7 @@ static void onBoat(int snum, ESyncBits &actions)
p->VBumpNow--; p->VBumpNow--;
if (p->VBumpTarget > p->VBumpNow) if (p->VBumpTarget > p->VBumpNow)
p->VBumpNow = p->VBumpTarget; p->VBumpNow = p->VBumpTarget;
horiz = p->VBumpNow / 3; horiz = p->VBumpNow / 3.;
} }
else else
{ {