From 8b519631f8f5581985d325b1155e65089610eb94 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 12 Aug 2016 15:40:17 +0100 Subject: [PATCH] * Keep the camera still when ending a NiGHTS map. http://gfycat.com/ComplicatedComposedAoudad * Correcting an earlier oversight with the SPR2_ defaulting system for super forms. --- src/p_mobj.c | 2 +- src/p_user.c | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 8de79fe92..4eb989a2d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -451,7 +451,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) spr2 = SPR2_GASP; break; case SPR2_SJMP: - spr2 = SPR2_JUMP; + spr2 = (player->charflags & SF_NOJUMPSPIN) ? SPR2_SSPG : SPR2_SSPN; break; case SPR2_SSPG: spr2 = SPR2_SPNG; diff --git a/src/p_user.c b/src/p_user.c index 6cc32c89a..583d2bb4d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5781,7 +5781,7 @@ static void P_NiGHTSMovement(player_t *player) return; } - if (player->exiting > 0) //&& player->exiting < 2*TICRATE) + if (player->exiting > 0) // && player->exiting < 2*TICRATE) { player->mo->momx = player->mo->momy = 0; @@ -8158,10 +8158,15 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall pviewheight = FixedMul(cv_viewheight.value<scale); - if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight; + if (!(player->pflags & PF_NIGHTSMODE && player->exiting)) // I never liked how the camera moved with the player. + { + if (mo->eflags & MFE_VERTICALFLIP) + z = mo->z + mo->height - pviewheight - camheight; + else + z = mo->z + pviewheight + camheight; + } else - z = mo->z + pviewheight + camheight; + z = thiscam->z; // move camera down to move under lower ceilings newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1)); @@ -8418,12 +8423,17 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall f2 = viewpointy-thiscam->y; dist = FixedHypot(f1, f2); - if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + if (!(player->pflags & PF_NIGHTSMODE && player->exiting)) // Ditto. + { + if (mo->eflags & MFE_VERTICALFLIP) + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + else + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + if (player->playerstate != PST_DEAD) + angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' + } else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); - if (player->playerstate != PST_DEAD && !(player->pflags & PF_NIGHTSMODE && player->exiting)) - angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' + angle = 0; if (twodlevel || (mo->flags2 & MF2_TWOD) || !camstill) // Keep the view still... {