From f9b6fba0b54f1fba2be922aa6bc7d9551efd28b4 Mon Sep 17 00:00:00 2001 From: Sunk <69110309+Sunketchupm@users.noreply.github.com> Date: Sun, 16 Mar 2025 07:20:29 -0400 Subject: [PATCH] Fix revamped pvp oversight (#706) --- src/game/interaction.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game/interaction.c b/src/game/interaction.c index 6edf0fc54..b0aa53adf 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -1467,12 +1467,14 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim) return FALSE; } +#define PLAYER_IN_ROLLOUT_FLIP(m) ((m->action == ACT_FORWARD_ROLLOUT || m->action == ACT_BACKWARD_ROLLOUT) && m->actionState == 1) + // see if it was an attack u32 interaction = determine_interaction(attacker, cVictim->marioObj); // Specfically override jump kicks to prevent low damage and low knockback kicks if (interaction & INT_HIT_FROM_BELOW && attacker->action == ACT_JUMP_KICK) { interaction = INT_KICK; } // Allow rollouts to attack - else if ((attacker->action == ACT_FORWARD_ROLLOUT || attacker->action == ACT_BACKWARD_ROLLOUT) && attacker->actionState == 1) { interaction = INT_HIT_FROM_BELOW; } + else if (PLAYER_IN_ROLLOUT_FLIP(attacker)) { interaction = INT_HIT_FROM_BELOW; } if (!(interaction & INT_ANY_ATTACK) || (interaction & INT_HIT_FROM_ABOVE) || !passes_pvp_interaction_checks(attacker, cVictim)) { return FALSE; } @@ -1505,12 +1507,12 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim) u8 forceAllowAttack = FALSE; if (gServerSettings.pvpType == PLAYER_PVP_REVAMPED) { // Give slidekicks trade immunity by making them (almost) invincible - // Also give rollouts immunity to dives + // Also give rollout flips immunity to dives if ((cVictim->action == ACT_SLIDE_KICK && attacker->action != ACT_SLIDE_KICK) || - ((cVictim->action == ACT_FORWARD_ROLLOUT || cVictim->action == ACT_BACKWARD_ROLLOUT) && attacker->action == ACT_DIVE)) { + (PLAYER_IN_ROLLOUT_FLIP(cVictim) && attacker->action == ACT_DIVE)) { return FALSE; } else if ((attacker->action == ACT_SLIDE_KICK) || - ((attacker->action == ACT_FORWARD_ROLLOUT || attacker->action == ACT_BACKWARD_ROLLOUT) && cVictim->action == ACT_DIVE)) { + (PLAYER_IN_ROLLOUT_FLIP(cVictim) && cVictim->action == ACT_DIVE)) { forceAllowAttack = TRUE; } } @@ -1521,6 +1523,8 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim) } } +#undef PLAYER_IN_ROLLOUT_FLIP + // determine if ground pound should be ignored if (attacker->action == ACT_GROUND_POUND) { // not moving down yet?