From cde56dbe6ce9851b5f86090174af7ebea53dfb8b Mon Sep 17 00:00:00 2001 From: lachwright Date: Wed, 20 Nov 2019 21:02:34 +0800 Subject: [PATCH] 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)) {