Make player reset action when hitting horizontal springs

This commit is contained in:
Lucas S. Vieira 2025-04-09 23:30:21 -03:00
parent a6089ca702
commit ea56260554

View file

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