mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- Duke/RR: Repair angle test when adjusting velocity.
* Initially figured I could just use the sign of the angle adjustment, but the vehicle code makes left/right reversals that necessitate using the flags for this.
This commit is contained in:
parent
a24b8499fc
commit
19ddc1ee51
1 changed files with 3 additions and 2 deletions
|
@ -1735,7 +1735,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
|
|||
int currSpeed = int(p->MotoSpeed);
|
||||
if (p->MotoSpeed >= 20 && p->on_ground == 1 && (flags & (VEH_TURNLEFT|VEH_TURNRIGHT)))
|
||||
{
|
||||
velAdjustment = adjust * Sgn(p->sync.avel);
|
||||
velAdjustment = (flags & VEH_TURNLEFT) ? -adjust : adjust;
|
||||
auto angAdjustment = (350 << 21) * velAdjustment.Sgn();
|
||||
|
||||
if (p->moto_on_mud || p->moto_on_oil || !p->NotOnWater)
|
||||
|
@ -1831,7 +1831,8 @@ static void onBoat(int snum, ESyncBits &actions)
|
|||
if (p->MotoSpeed > 0 && p->on_ground == 1 && (flags & (VEH_TURNLEFT|VEH_TURNRIGHT)))
|
||||
{
|
||||
int currSpeed = int(p->MotoSpeed * 4.);
|
||||
DAngle velAdjustment = mapangle(-510) * Sgn(p->sync.avel);
|
||||
constexpr DAngle adjust = mapangle(-510);
|
||||
DAngle velAdjustment = (flags & VEH_TURNLEFT) ? -adjust : adjust;
|
||||
auto angAdjustment = (350 << 21) * velAdjustment.Sgn();
|
||||
|
||||
if (p->moto_do_bump)
|
||||
|
|
Loading…
Reference in a new issue