Merge branch 'the-big-large-slope-physics' into 'the-scary-22-merge'

The big large slope physics

See merge request KartKrew/Kart!320
This commit is contained in:
Sal 2020-10-18 01:16:24 -04:00
commit bceffa9c2f
2 changed files with 7 additions and 2 deletions

View file

@ -953,7 +953,7 @@ void P_ButteredSlope(mobj_t *mo)
return; // Allow the player to stand still on slopes below a certain steepness return; // Allow the player to stand still on slopes below a certain steepness
} }
thrust = FINESINE(mo->standingslope->zangle>>ANGLETOFINESHIFT) * 4 / 5 * (mo->eflags & MFE_VERTICALFLIP ? 1 : -1); thrust = FINESINE(mo->standingslope->zangle>>ANGLETOFINESHIFT) * 5 / 4 * (mo->eflags & MFE_VERTICALFLIP ? 1 : -1);
if (mo->player) { if (mo->player) {
fixed_t mult = FRACUNIT; fixed_t mult = FRACUNIT;
@ -963,7 +963,7 @@ void P_ButteredSlope(mobj_t *mo)
if (P_MobjFlip(mo) * mo->standingslope->zdelta < 0) if (P_MobjFlip(mo) * mo->standingslope->zdelta < 0)
angle ^= ANGLE_180; angle ^= ANGLE_180;
mult = FRACUNIT + (FRACUNIT + FINECOSINE(angle>>ANGLETOFINESHIFT))*3/2; mult = FRACUNIT + (FRACUNIT + FINECOSINE(angle>>ANGLETOFINESHIFT))*4/3;
} }
thrust = FixedMul(thrust, mult); thrust = FixedMul(thrust, mult);

View file

@ -1855,6 +1855,11 @@ static void P_3dMovement(player_t *player)
totalthrust.x = totalthrust.y = 0; // I forget if this is needed totalthrust.x = totalthrust.y = 0; // I forget if this is needed
totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
if (player->kartstuff[k_sneakertimer] > 0)
{
totalthrust.z = -(totalthrust.z);
}
// Get the old momentum; this will be needed at the end of the function! -SH // Get the old momentum; this will be needed at the end of the function! -SH
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);