From 89f518a8a3fc0abe71e15cc0ea1147cc4b77445f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 4 Apr 2017 23:12:43 +0100 Subject: [PATCH] FuriousFox discovered a crash, realised I wasn't careful here. --- src/p_user.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 44077d679..d46f5130e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9829,10 +9829,7 @@ void P_PlayerAfterThink(player_t *player) player->mo->height = FixedDiv(P_GetPlayerHeight(player), FixedDiv(14*FRACUNIT,10*FRACUNIT)); if (player->mo->tracer->player && !(player->mo->tracer->player->pflags & PF_CANCARRY)) - { player->powers[pw_carry] = CR_NONE; - P_SetTarget(&player->mo->tracer, NULL); - } if (player->mo->eflags & MFE_VERTICALFLIP) { @@ -9840,10 +9837,7 @@ void P_PlayerAfterThink(player_t *player) && (player->mo->tracer->eflags & MFE_VERTICALFLIP)) // Reverse gravity check for the carrier - Flame player->mo->z = player->mo->tracer->z + player->mo->tracer->height + FixedMul(FRACUNIT, player->mo->scale); else - { player->powers[pw_carry] = CR_NONE; - P_SetTarget(&player->mo->tracer, NULL); - } } else { @@ -9851,10 +9845,7 @@ void P_PlayerAfterThink(player_t *player) && !(player->mo->tracer->eflags & MFE_VERTICALFLIP)) // Correct gravity check for the carrier - Flame player->mo->z = player->mo->tracer->z - player->mo->height - FixedMul(FRACUNIT, player->mo->scale); else - { player->powers[pw_carry] = CR_NONE; - P_SetTarget(&player->mo->tracer, NULL); - } } if (player->mo->tracer->health <= 0) @@ -9881,12 +9872,12 @@ void P_PlayerAfterThink(player_t *player) } if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius) - { player->powers[pw_carry] = CR_NONE; - P_SetTarget(&player->mo->tracer, NULL); - } - P_SetPlayerMobjState(player->mo, S_PLAY_RIDE); + if (player->powers[pw_carry] != CR_NONE) + P_SetPlayerMobjState(player->mo, S_PLAY_RIDE); + else + P_SetTarget(&player->mo->tracer, NULL); if (player-players == consoleplayer && botingame) CV_SetValue(&cv_analog2, (player->powers[pw_carry] != CR_PLAYER));