From b959c01349ba98ac62ff72964346ee2ae5f33206 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Fri, 20 Mar 2020 11:04:26 +0100 Subject: [PATCH 1/2] Fix antigrav respawn, no respawn flag, and remove spinout when respawning --- src/k_kart.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 27a4b1e1f..edfcf6991 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2048,6 +2048,8 @@ void K_RespawnChecker(player_t *player) fixed_t destx = 0, desty = 0, destz = 0; player->mo->momx = player->mo->momy = player->mo->momz = 0; + player->kartstuff[k_spinouttimer] = 0; + player->kartstuff[k_wipeoutslow] = 0; // Don't spinout anymore player->powers[pw_flashing] = 2; player->powers[pw_nocontrol] = 2; @@ -2059,9 +2061,20 @@ void K_RespawnChecker(player_t *player) destz = (player->starpostz << FRACBITS); if (player->kartstuff[k_starpostflip]) + { + // This variable is set from the settings of the best waypoint, thus this waypoint is FLIPPED as well. + // So we should flip the player in advance for it as well. + player->mo->flags2 |= MF2_OBJECTFLIP; + player->mo->eflags |= MFE_VERTICALFLIP; destz -= (128 * mapobjectscale) + (player->mo->height); + } else + { + // Ditto, but this waypoint isn't flipped, so make sure the player also isn't flipped! + player->mo->flags2 &= ~MF2_OBJECTFLIP; + player->mo->eflags &= ~MFE_VERTICALFLIP; destz += (128 * mapobjectscale); + } if (player->mo->x != destx || player->mo->y != desty || player->mo->z != destz) { @@ -6068,6 +6081,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player) (bestwaypoint != NULL) && (bestwaypoint != player->nextwaypoint) && (player->kartstuff[k_respawn] == 0) && + (!(bestwaypoint->mobj->spawnpoint->options & MTF_AMBUSH)) && // Don't try to respawn on waypoints with the MTF_AMBUSH (No respawn) flag! (K_GetWaypointIsShortcut(bestwaypoint) == false) && (K_GetWaypointIsEnabled(bestwaypoint) == true)) { size_t i = 0U; From 80e04a20350bc385d5f0dcac26cca114f0877a89 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sun, 22 Mar 2020 11:32:55 +0100 Subject: [PATCH 2/2] Use proper respawn check, don't cancel spinout, but prevent dropdashing when respawning with spinout --- src/k_kart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index edfcf6991..59760761c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2048,8 +2048,6 @@ void K_RespawnChecker(player_t *player) fixed_t destx = 0, desty = 0, destz = 0; player->mo->momx = player->mo->momy = player->mo->momz = 0; - player->kartstuff[k_spinouttimer] = 0; - player->kartstuff[k_wipeoutslow] = 0; // Don't spinout anymore player->powers[pw_flashing] = 2; player->powers[pw_nocontrol] = 2; @@ -2209,7 +2207,7 @@ void K_RespawnChecker(player_t *player) // Sal: The old behavior was stupid and prone to accidental usage. // Let's rip off Mania instead, and turn this into a Drop Dash! - if (cmd->buttons & BT_ACCELERATE) + if (cmd->buttons & BT_ACCELERATE && !player->kartstuff[k_spinouttimer]) // Lat: Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway) player->kartstuff[k_dropdash]++; else player->kartstuff[k_dropdash] = 0; @@ -6081,7 +6079,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player) (bestwaypoint != NULL) && (bestwaypoint != player->nextwaypoint) && (player->kartstuff[k_respawn] == 0) && - (!(bestwaypoint->mobj->spawnpoint->options & MTF_AMBUSH)) && // Don't try to respawn on waypoints with the MTF_AMBUSH (No respawn) flag! + (K_GetWaypointIsSpawnpoint(bestwaypoint)) && // Don't try to respawn on waypoints that are marked with no respawn (K_GetWaypointIsShortcut(bestwaypoint) == false) && (K_GetWaypointIsEnabled(bestwaypoint) == true)) { size_t i = 0U;