mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Autobrake polish!
* Make it actually look like a brake, so people can tell it's on instead of just having high friction. * Fix it fucking with spring chains (caused by being unwittingly active for the first tic of spring collision).
This commit is contained in:
parent
eacc589ae1
commit
fc1abdd7f8
2 changed files with 13 additions and 0 deletions
|
@ -285,6 +285,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
|
||||
if (spring->info->painchance != 2)
|
||||
{
|
||||
if (object->player)
|
||||
object->player->pflags &= ~PF_APPLYAUTOBRAKE;
|
||||
|
||||
if ((horizspeed && vertispeed) || (object->player && object->player->homing)) // Mimic SA
|
||||
{
|
||||
object->momx = object->momy = 0;
|
||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -11233,6 +11233,16 @@ void P_PlayerThink(player_t *player)
|
|||
|
||||
if (!currentlyonground)
|
||||
acceleration /= 2;
|
||||
// fake skidding! see P_SkidStuff for reference on conditionals
|
||||
else if (!player->skidtime && !(player->mo->eflags & MFE_GOOWATER) && !(player->pflags & (PF_JUMPED|PF_SPINNING|PF_SLIDING)) && !(player->charflags & SF_NOSKID) && P_AproxDistance(player->mo->momx, player->mo->momy) >= FixedMul(player->runspeed/2, player->mo->scale))
|
||||
{
|
||||
if (player->mo->state-states != S_PLAY_SKID)
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SKID);
|
||||
player->mo->tics = player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS;
|
||||
|
||||
if (P_IsLocalPlayer(player)) // the sound happens way more frequently now, so give co-op players' ears a brake...
|
||||
S_StartSound(player->mo, sfx_skid);
|
||||
}
|
||||
|
||||
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
|
||||
acceleration = FixedMul(acceleration<<FRACBITS, player->mo->movefactor)>>FRACBITS;
|
||||
|
|
Loading…
Reference in a new issue