From d609cfc9e32b5dbf66cb790bfe4f691ad83b85f1 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 21 Jun 2020 03:06:42 -0500 Subject: [PATCH 1/3] Make it so Linedef type 422 instead sets `cusval` when the titlemap is in action. I have no idea why it wasn't like this before, but oh well. --- src/p_spec.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 7708f2f1e..1f32c9eda 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2951,13 +2951,13 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // If titlemap, set the camera ref for title's thinker // This is not revoked until overwritten; awayviewtics is ignored if (titlemapinaction) - { titlemapcameraref = altview; - return; + else + { + P_SetTarget(&mo->player->awayviewmobj, altview); + mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS; } - P_SetTarget(&mo->player->awayviewmobj, altview); - mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS; if (line->flags & ML_NOCLIMB) // lets you specify a vertical angle { @@ -2971,10 +2971,19 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) aim *= (ANGLE_90>>8); aim /= 90; aim <<= 8; - mo->player->awayviewaiming = (angle_t)aim; + if (titlemapinaction) + titlemapcameraref->cusval = (angle_t)aim; + else + mo->player->awayviewaiming = (angle_t)aim; } else - mo->player->awayviewaiming = 0; // straight ahead + { + // straight ahead + if (titlemapinaction) + titlemapcameraref->cusval = 0; + else + mo->player->awayviewaiming = 0; + } } break; From 6fe087460642d243356349d8612daa5c722ec9fa Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 21 Jun 2020 23:21:42 -0500 Subject: [PATCH 2/3] Stop resetting cusval cause that's annoying --- src/p_spec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 1f32c9eda..e45220345 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2979,10 +2979,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) else { // straight ahead - if (titlemapinaction) - titlemapcameraref->cusval = 0; - else + if (!titlemapinaction) mo->player->awayviewaiming = 0; + // don't do cusval cause that's annoying } } break; From f0787077e395920ec2461e99c6432b287ace7cc2 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Mon, 22 Jun 2020 04:14:42 -0500 Subject: [PATCH 3/3] More people ought to know what modulo is... Or modulous if your prefer. --- src/p_spec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index e45220345..6f5eba4c4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2964,10 +2964,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT32 aim; aim = sides[line->sidenum[0]].textureoffset>>FRACBITS; - while (aim < 0) - aim += 360; - while (aim >= 360) - aim -= 360; + aim = (aim + 360) % 360; aim *= (ANGLE_90>>8); aim /= 90; aim <<= 8;