Fix sliding behaviour when hitting springs

This commit is contained in:
Lucas S. Vieira 2025-04-10 00:33:38 -03:00
parent b7d252467f
commit b58e48d0f5
2 changed files with 4 additions and 6 deletions

View file

@ -402,10 +402,8 @@ _spring_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uint8_t is_r
player.anim_dir = -1;
state->anim_state.animation = 1;
sound_play_vag(sfx_sprn, 0);
if(player.action != ACTION_ROLLING) {
if(player.action != ACTION_ROLLING)
player_set_action(&player, ACTION_NONE);
player.sliding = 0;
}
} else if(state->flipmask & MASK_FLIP_ROTCW) { // Right-pointing spring
//player.pos.vx = (solidity_vx + solidity_w + player_width + 8) << 12;
player.ev_left.collided = 0; // Detach player from left wall if needed
@ -415,10 +413,8 @@ _spring_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uint8_t is_r
player.anim_dir = 1;
state->anim_state.animation = 1;
sound_play_vag(sfx_sprn, 0);
if(player.action != ACTION_ROLLING) {
if(player.action != ACTION_ROLLING)
player_set_action(&player, ACTION_NONE);
player.sliding = 0;
}
} else if(state->flipmask == 0) { // Top-pointing spring
player.pos.vy = (solidity_vy - (player_height >> 1)) << 12;
player.grnd = 0;

View file

@ -1726,6 +1726,8 @@ player_set_action(Player *player, PlayerAction action)
if(player->action == ACTION_HURT) {
player->ctrllock = 0;
player->iframes = PLAYER_HURT_IFRAMES;
} else if(player->action == ACTION_GLIDE) {
player->sliding = 0;
}
player->action = action;
}