Skip to content

Commit

Permalink
game: When using ki charge after moving with ki boost, make decelerat…
Browse files Browse the repository at this point in the history
…ion smoother
  • Loading branch information
LegendaryGuard committed Mar 24, 2024
1 parent 19c49e6 commit d4f1568
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,13 +2185,19 @@ static void PM_KiCharge( void ) { // BFP - Ki Charge

pm->cmd.forwardmove = pm->cmd.rightmove = pm->cmd.upmove = 0;

VectorClear( pm->ps->velocity );
// Decelerate the fall
pm->ps->velocity[2] *= 0.85;

if ( pm->cmd.buttons & ( BUTTON_ATTACK | BUTTON_KI_USE | BUTTON_MELEE | BUTTON_BLOCK | BUTTON_ENABLEFLIGHT ) ) {
pm->cmd.buttons &= ~( BUTTON_ATTACK | BUTTON_KI_USE | BUTTON_MELEE | BUTTON_BLOCK | BUTTON_ENABLEFLIGHT );
}

if ( pm->ps->powerups[PW_FLIGHT] <= 0 ) {
// Decelerate smoothly when it's on air
if ( !( pml.groundTrace.contents & MASK_PLAYERSOLID ) ) {
pm->ps->velocity[0] *= 0.85;
pm->ps->velocity[1] *= 0.85;
}
pm->ps->pm_flags |= PMF_FALLING; // Handle PMF_FALLING flag
}

Expand Down

0 comments on commit d4f1568

Please sign in to comment.