From cde56dbe6ce9851b5f86090174af7ebea53dfb8b Mon Sep 17 00:00:00 2001 From: lachwright Date: Wed, 20 Nov 2019 21:02:34 +0800 Subject: [PATCH 1/2] WIP fix signpost issues with exitmove --- src/p_spec.c | 8 ++++---- src/p_spec.h | 2 ++ src/p_user.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f1a697399..1121e2348 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4072,8 +4072,8 @@ void P_SetupSignExit(player_t *player) if (thing->type != MT_SIGN) continue; - if (!player->mo->target || player->mo->target->type != MT_SIGN) - P_SetTarget(&player->mo->target, thing); + if (!endsign || P_MobjWasRemoved(endsign)) + endsign = thing; if (thing->state != &states[thing->info->spawnstate]) continue; @@ -4101,8 +4101,8 @@ void P_SetupSignExit(player_t *player) if (thing->type != MT_SIGN) continue; - if (!player->mo->target || player->mo->target->type != MT_SIGN) - P_SetTarget(&player->mo->target, thing); + if (!endsign || P_MobjWasRemoved(endsign)) + endsign = thing; if (thing->state != &states[thing->info->spawnstate]) continue; diff --git a/src/p_spec.h b/src/p_spec.h index d7176afee..e2abcebb8 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -21,6 +21,8 @@ extern mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpo extern mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs extern mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs +mobj_t *endsign; + // GETSECSPECIAL (specialval, section) // // Pulls out the special # from a particular section. diff --git a/src/p_user.c b/src/p_user.c index 47812744e..79b6d7e75 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9629,10 +9629,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall mo = player->mo; - if (player->exiting && mo->target && mo->target->type == MT_SIGN) - sign = mo->target; + if (player->exiting && endsign && !P_MobjWasRemoved(endsign)) + sign = endsign; - cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! + cameranoclip = (sign || player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! if (!(player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || tutorialmode)) { From 28fbdab3d426913d6e4cfb3bea44d770ca513026 Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 5 Dec 2019 12:58:44 +0800 Subject: [PATCH 2/2] Make signpost camera distance consistent in analog mode & don't target signpost in 2D mode --- src/p_user.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7e3259306..6ec45290a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9682,7 +9682,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player->exiting) { if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint - && !(gametype == GT_COOP && (netgame || multiplayer) && cv_exitmove.value)) + && !(gametype == GT_COOP && (netgame || multiplayer) && cv_exitmove.value) + && !(twodlevel || (mo->flags2 & MF2_TWOD))) sign = mo->target; else if ((player->powers[pw_carry] == CR_NIGHTSMODE) && !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1] @@ -9888,18 +9889,16 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camheight = FixedMul(camheight, 3*FRACUNIT/2); } - // x1.2 dist for analog - if (P_AnalogMove(player)) - { - dist = FixedMul(dist, 6*FRACUNIT/5); - camheight = FixedMul(camheight, 6*FRACUNIT/5); - } - - if (sign) + if (sign) // signpost camera has specific placement { camheight = mo->scale << 7; camspeed = FRACUNIT/12; } + else if (P_AnalogMove(player)) // x1.2 dist for analog + { + dist = FixedMul(dist, 6*FRACUNIT/5); + camheight = FixedMul(camheight, 6*FRACUNIT/5); + } if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] == CR_ROPEHANG || player->powers[pw_carry] == CR_GENERIC || player->powers[pw_carry] == CR_MACESPIN)) dist <<= 1;