mirror of
https://github.com/luksamuk/engine-psx.git
synced 2025-04-28 13:28:02 +03:00
Fix a bug with premature slide recovery
This commit is contained in:
parent
3c64597f21
commit
b111971343
1 changed files with 15 additions and 4 deletions
11
src/player.c
11
src/player.c
|
@ -669,6 +669,7 @@ _player_update_collision_tb(Player *player)
|
|||
player->sliding = 0;
|
||||
if(player->action == ACTION_GLIDE) {
|
||||
if(abs(player->vel.vx) <= KNUX_GLIDE_FRICTION) {
|
||||
// (duplicated on gliding action)
|
||||
player_set_action(player, ACTION_GLIDERECOVER);
|
||||
player->framecount = 12;
|
||||
player->vel.vx = 0;
|
||||
|
@ -1202,11 +1203,21 @@ player_update(Player *player)
|
|||
player->spinrev = 0;
|
||||
} else if(player->action == ACTION_GLIDE) {
|
||||
if(!input_pressing(&player->input, PAD_CROSS)) {
|
||||
if(player->sliding) {
|
||||
// Prevent erroneously treating a premature slide
|
||||
// interruption as a drop.
|
||||
// (duplicated code from sliding part on ground collision)
|
||||
player->sliding = 0;
|
||||
player_set_action(player, ACTION_GLIDERECOVER);
|
||||
player->framecount = 12;
|
||||
player->vel.vx = 0;
|
||||
} else {
|
||||
// Cancel gliding
|
||||
player_set_action(player, ACTION_DROP);
|
||||
player->vel.vx >>= 2; // times 0.25
|
||||
player->airdirlock = 1;
|
||||
}
|
||||
}
|
||||
} else if(player->action == ACTION_CLIMB) {
|
||||
if(!player->ev_climbdrop.collided) {
|
||||
// Fall off bottom of wall if no wall is found at Y + height radius
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue