diff --git a/src/k_kart.c b/src/k_kart.c index 652ec5fb6..ea05bbde1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -372,6 +372,9 @@ boolean K_IsPlayerLosing(player_t *player) INT32 winningpos = 1; UINT8 i, pcount = 0; + if (player->pflags & PF_NOCONTEST) + return true; + if (battlecapsules && numtargets == 0) return true; // Didn't even TRY? @@ -381,6 +384,9 @@ boolean K_IsPlayerLosing(player_t *player) if (player->position == 1) return false; + if (specialstageinfo.valid == true) + return false; // anything short of DNF is COOL + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) @@ -7567,8 +7573,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) //CONS_Printf("cam: %d, dest: %d\n", player->karthud[khud_boostcam], player->karthud[khud_destboostcam]); } - player->karthud[khud_timeovercam] = 0; - // Make ABSOLUTELY SURE that your flashing tics don't get set WHILE you're still in hit animations. if (player->spinouttimer != 0 || player->wipeoutslow != 0) { diff --git a/src/objects/ufo.c b/src/objects/ufo.c index d2fffc008..6fe0af881 100644 --- a/src/objects/ufo.c +++ b/src/objects/ufo.c @@ -281,10 +281,11 @@ static void UFOMove(mobj_t *ufo) if (curWaypoint == NULL || destWaypoint == NULL) { // Waypoints aren't valid. - // Just stand still. + // Just go straight up. + // :japanese_ogre: : "Abrupt and funny is the funniest way to end the special stage anyways" ufo->momx = 0; ufo->momy = 0; - ufo->momz = 0; + ufo->momz = ufo_speed(ufo); return; } @@ -365,8 +366,23 @@ static void UFOMove(mobj_t *ufo) if (reachedEnd == true) { - CONS_Printf("You lost...\n"); - ufo_waypoint(ufo) = -1; // Invalidate + UINT8 i; + + // Invalidate UFO/emerald + ufo_waypoint(ufo) = -1; + ufo->flags &= ~(MF_SPECIAL|MF_PICKUPFROMBELOW); + + // Disable player + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i]) + continue; + if (players[i].spectator) + continue; + + players[i].pflags |= PF_NOCONTEST; + P_DoPlayerExit(&players[i]); + } } if (pathfindsuccess == true) @@ -655,7 +671,10 @@ void Obj_UFOPieceThink(mobj_t *piece) fixed_t sc = FixedDiv(FixedDiv(ufo->ceilingz - stemZ, piece->scale), 15 * FRACUNIT); UFOMoveTo(piece, ufo->x, ufo->y, stemZ); - piece->spriteyscale = sc; + if (sc > 0) + { + piece->spriteyscale = sc; + } break; } default: diff --git a/src/p_inter.c b/src/p_inter.c index 77020eb08..89229f8ac 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -32,6 +32,7 @@ // SRB2kart #include "k_kart.h" #include "k_battle.h" +#include "k_specialstage.h" #include "k_pwrlv.h" #include "k_grandprix.h" #include "k_respawn.h" @@ -892,7 +893,7 @@ boolean P_CheckRacers(void) } } - if (numPlaying <= 1) + if (numPlaying <= 1 || specialstageinfo.valid == true) { // Never do this without enough players. eliminateLast = false; diff --git a/src/p_user.c b/src/p_user.c index b333eabe3..a27890817 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -54,6 +54,7 @@ #include "k_bot.h" #include "k_grandprix.h" #include "k_boss.h" +#include "k_specialstage.h" #include "k_terrain.h" // K_SpawnSplashForMobj #include "k_color.h" #include "k_follower.h" @@ -1307,7 +1308,16 @@ void P_DoPlayerExit(player_t *player) P_EndingMusic(player); if (P_CheckRacers() && !exitcountdown) - exitcountdown = raceexittime+1; + { + if (specialstageinfo.valid == true && losing == true) + { + exitcountdown = (5*TICRATE)/2; + } + else + { + exitcountdown = raceexittime+1; + } + } } else if ((gametyperules & GTR_BUMPERS)) // Battle Mode exiting { @@ -3048,7 +3058,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall return true; } - if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT)) // 1 for momentum keep, 2 for turnaround + if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT) && player->karthud[khud_timeovercam] != 0) // 1 for momentum keep, 2 for turnaround timeover = (player->karthud[khud_timeovercam] > 2*TICRATE ? 2 : 1); else timeover = 0;