mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- fixed issues with negative values being passed to sqrt für calculating RRRA's motorcyle and boat.
This commit is contained in:
parent
1cf954920c
commit
f5ce60fa6e
1 changed files with 4 additions and 4 deletions
|
@ -595,7 +595,7 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
|
|||
turnvel -= isTurboTurnTime() && p->MotoSpeed > 0 ? baseVel : baseVel * velScale;
|
||||
|
||||
if (hidInput->mouseturnx < 0)
|
||||
turnvel -= sqrt((p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * -(hidInput->mouseturnx / factor) * 2.);
|
||||
turnvel -= Sgn(baseVel) * sqrt((p->MotoSpeed > 0 ? abs(baseVel) : abs(baseVel) * velScale) * -(hidInput->mouseturnx / factor) * 2.);
|
||||
|
||||
if (hidInput->dyaw < 0)
|
||||
turnvel += (p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * hidInput->dyaw;
|
||||
|
@ -614,7 +614,7 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
|
|||
turnvel += isTurboTurnTime() && p->MotoSpeed > 0 ? baseVel : baseVel * velScale;
|
||||
|
||||
if (hidInput->mouseturnx > 0)
|
||||
turnvel += sqrt((p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * (hidInput->mouseturnx / factor) * 2.);
|
||||
turnvel += Sgn(baseVel) * sqrt((p->MotoSpeed > 0 ? abs(baseVel) : abs(baseVel) * velScale) * (hidInput->mouseturnx / factor) * 2.);
|
||||
|
||||
if (hidInput->dyaw > 0)
|
||||
turnvel += (p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * hidInput->dyaw;
|
||||
|
@ -670,7 +670,7 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
|
|||
turnvel -= isTurboTurnTime() ? baseVel : baseVel * velScale;
|
||||
|
||||
if (hidInput->mouseturnx < 0)
|
||||
turnvel -= sqrt(baseVel * -(hidInput->mouseturnx / factor) * 2.);
|
||||
turnvel -= Sgn(baseVel) * sqrt(abs(baseVel) * -(hidInput->mouseturnx / factor) * 2.);
|
||||
|
||||
if (hidInput->dyaw < 0)
|
||||
turnvel += baseVel * hidInput->dyaw;
|
||||
|
@ -691,7 +691,7 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
|
|||
turnvel += isTurboTurnTime() ? baseVel : baseVel * velScale;
|
||||
|
||||
if (hidInput->mouseturnx > 0)
|
||||
turnvel += sqrt(baseVel * (hidInput->mouseturnx / factor) * 2.);
|
||||
turnvel += Sgn(baseVel) * sqrt(abs(baseVel) * (hidInput->mouseturnx / factor) * 2.);
|
||||
|
||||
if (hidInput->dyaw > 0)
|
||||
turnvel += baseVel * hidInput->dyaw;
|
||||
|
|
Loading…
Reference in a new issue