mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-14 00:21:30 +00:00
- Duke: Tidy up some repeated bools in vehicle input code.
This commit is contained in:
parent
37dda1aa0e
commit
51a20211f3
1 changed files with 8 additions and 8 deletions
|
@ -557,13 +557,13 @@ static float motoApplyTurn(player_struct* p, HIDInput* const hidInput, bool cons
|
|||
{
|
||||
resetTurnHeldAmt();
|
||||
|
||||
if (kbdLeft || hidInput->mouseturnx < 0 || hidInput->joyaxes[JOYAXIS_Yaw] > 0)
|
||||
if (p->vehTurnLeft)
|
||||
{
|
||||
p->TiltStatus -= (float)factor;
|
||||
if (p->TiltStatus < -10)
|
||||
p->TiltStatus = -10;
|
||||
}
|
||||
else if (kbdRight || hidInput->mouseturnx > 0 || hidInput->joyaxes[JOYAXIS_Yaw] < 0)
|
||||
else if (p->vehTurnRight)
|
||||
{
|
||||
p->TiltStatus += (float)factor;
|
||||
if (p->TiltStatus > 10)
|
||||
|
@ -572,12 +572,12 @@ static float motoApplyTurn(player_struct* p, HIDInput* const hidInput, bool cons
|
|||
}
|
||||
else
|
||||
{
|
||||
if (kbdLeft || kbdRight || p->moto_drink || hidInput->mouseturnx || hidInput->joyaxes[JOYAXIS_Yaw])
|
||||
if (p->vehTurnLeft || p->vehTurnRight || p->moto_drink)
|
||||
{
|
||||
constexpr float velScale = (3.f / 10.f);
|
||||
const float baseVel = (buttonMap.ButtonDown(gamefunc_Move_Backward) || hidInput->joyaxes[JOYAXIS_Forward] < 0) && p->MotoSpeed <= 0 ? -VEHICLETURN : VEHICLETURN;
|
||||
|
||||
if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->joyaxes[JOYAXIS_Yaw] > 0)
|
||||
if (p->vehTurnLeft || p->moto_drink < 0)
|
||||
{
|
||||
p->TiltStatus -= (float)factor;
|
||||
|
||||
|
@ -596,7 +596,7 @@ static float motoApplyTurn(player_struct* p, HIDInput* const hidInput, bool cons
|
|||
updateTurnHeldAmt(factor);
|
||||
}
|
||||
|
||||
if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->joyaxes[JOYAXIS_Yaw] < 0)
|
||||
if (p->vehTurnRight || p->moto_drink > 0)
|
||||
{
|
||||
p->TiltStatus += (float)factor;
|
||||
|
||||
|
@ -645,12 +645,12 @@ static float boatApplyTurn(player_struct *p, HIDInput* const hidInput, bool cons
|
|||
|
||||
if (p->MotoSpeed)
|
||||
{
|
||||
if (kbdLeft || kbdRight || p->moto_drink || hidInput->mouseturnx || hidInput->joyaxes[JOYAXIS_Yaw])
|
||||
if (p->vehTurnLeft || p->vehTurnRight || p->moto_drink)
|
||||
{
|
||||
const float velScale = !p->NotOnWater? 1.f : (6.f / 19.f);
|
||||
const float baseVel = VEHICLETURN * velScale;
|
||||
|
||||
if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->joyaxes[JOYAXIS_Yaw] > 0)
|
||||
if (p->vehTurnLeft || p->moto_drink < 0)
|
||||
{
|
||||
if (!p->NotOnWater)
|
||||
{
|
||||
|
@ -671,7 +671,7 @@ static float boatApplyTurn(player_struct *p, HIDInput* const hidInput, bool cons
|
|||
updateTurnHeldAmt(factor);
|
||||
}
|
||||
|
||||
if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->joyaxes[JOYAXIS_Yaw] < 0)
|
||||
if (p->vehTurnRight || p->moto_drink > 0)
|
||||
{
|
||||
if (!p->NotOnWater)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue