diff --git a/src/p_mobj.c b/src/p_mobj.c index cc2ad1b8d..11076b381 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6323,27 +6323,6 @@ static boolean P_MobjDeadThink(mobj_t *mobj) case MT_PLAYER: /// \todo Have the player's dead body completely finish its animation even if they've already respawned. - if (mobj->player) - { - // Set players next respawn point to the next waypoint - // If they die while still in respawn state for extra safety. - if (mobj->player->nextwaypoint && mobj->player->respawn > 0) - { - mobj_t *currentwaypoint = mobj->player->currentwaypoint->mobj; - mobj_t *safewaypoint = mobj->player->nextwaypoint->mobj; - angle_t respawnangle = R_PointToAngle2(currentwaypoint->x, currentwaypoint->y, safewaypoint->x, safewaypoint->y); - - mobj->player->starposttime = mobj->player->realtime; - mobj->player->starpostz = safewaypoint->spawnpoint->z >> FRACBITS; - mobj->player->starpostflip = (safewaypoint->flags2 & MF2_OBJECTFLIP); - mobj->player->starpostangle = respawnangle; - - // Then do x and y - mobj->player->starpostx = safewaypoint->x >> FRACBITS; - mobj->player->starposty = safewaypoint->y >> FRACBITS; - } - } - if (!mobj->fuse) { // Go away. /// \todo Actually go ahead and remove mobj completely, and fix any bugs and crashes doing this creates. Chasecam should stop moving, and F12 should never return to it. diff --git a/src/p_user.c b/src/p_user.c index 15551ad7c..b61518acf 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2597,6 +2597,24 @@ static void P_DeathThink(player_t *player) else player->karthud[khud_timeovercam] = 0; + // Set players next respawn point to the next waypoint + // If they die while still in respawn state for extra safety. + if (player->nextwaypoint && player->respawn > 0) + { + mobj_t *currentwaypoint = player->currentwaypoint->mobj; + mobj_t *safewaypoint = player->nextwaypoint->mobj; + angle_t respawnangle = R_PointToAngle2(currentwaypoint->x, currentwaypoint->y, safewaypoint->x, safewaypoint->y); + + player->starposttime = player->realtime; + player->starpostz = safewaypoint->spawnpoint->z >> FRACBITS; + player->starpostflip = (safewaypoint->flags2 & MF2_OBJECTFLIP); + player->starpostangle = respawnangle; + + // Then do x and y + player->starpostx = safewaypoint->x >> FRACBITS; + player->starposty = safewaypoint->y >> FRACBITS; + } + K_KartPlayerHUDUpdate(player); if (player->pflags & PF_NOCONTEST)