From e5bad9af2cd43a6a64b17d909839eed60c415601 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 21 Mar 2023 21:37:25 +1100 Subject: [PATCH] - Duke/RR: Re-arrange the playsim angle calls. * Make them precisely where they were originally called from. --- source/games/duke/src/player_d.cpp | 21 +++++++++------------ source/games/duke/src/player_r.cpp | 22 +++++++++------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index e4304d23c..f7480d38f 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2728,8 +2728,7 @@ void processinput_d(int snum) doubvel = TICSPERFRAME; checklook(snum,actions); - double iif = 2.5; - auto oldpos = p->GetActor()->opos; + p->Angles.doViewYaw(&p->sync); if (p->on_crane != nullptr) { @@ -2744,6 +2743,8 @@ void processinput_d(int snum) p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floortexture == mirrortex) || !p->insector())); + p->Angles.doYawKeys(&p->sync); + // Shrinking code if (psectlotag == ST_2_UNDERWATER) @@ -2768,9 +2769,6 @@ void processinput_d(int snum) setForcedSyncInput(); } - //Do the quick lefts and rights - p->Angles.doViewYaw(&p->sync); - if (movementBlocked(p)) { doubvel = 0; @@ -2787,7 +2785,6 @@ void processinput_d(int snum) p->GetActor()->spr.Angles.Yaw += p->adjustavel(PlayerInputAngVel(snum)); } - p->Angles.doYawKeys(&p->sync); purplelavacheck(p); if (p->spritebridge == 0 && pact->insector()) @@ -2885,8 +2882,7 @@ void processinput_d(int snum) HORIZONLY: - if (psectlotag == 1 || p->spritebridge == 1) iif = 4; - else iif = 20; + double iif = (psectlotag == 1 || p->spritebridge == 1) ? 4 : 20; if (p->insector() && p->cursector->lotag == 2) k = 0; else k = 1; @@ -2947,6 +2943,7 @@ HORIZONLY: if (p->cursector != pact->sector()) ChangeActorSect(pact, p->cursector); + auto oldpos = p->GetActor()->opos; int retry = 0; while (ud.clipping == 0) { @@ -2997,15 +2994,15 @@ HORIZONLY: playerAimDown(snum, actions); } + p->Angles.doPitchKeys(&p->sync); + + p->checkhardlanding(); + if (SyncInput()) { p->GetActor()->spr.Angles.Pitch += GetPlayerHorizon(snum); } - p->Angles.doPitchKeys(&p->sync); - - p->checkhardlanding(); - //Shooting code/changes if (p->show_empty_weapon > 0) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index de4d93ecd..2c45dc42a 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3315,10 +3315,9 @@ void processinput_r(int snum) doubvel = TICSPERFRAME; checklook(snum, actions); + p->Angles.doViewYaw(&p->sync); p->apply_seasick(); - auto oldpos = p->GetActor()->opos; - if (p->on_crane != nullptr) { setForcedSyncInput(); @@ -3332,6 +3331,8 @@ void processinput_r(int snum) p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floortexture == mirrortex) || !p->insector())); + p->Angles.doYawKeys(&p->sync); + // Shrinking code if (psectlotag == ST_17_PLATFORM_UP || (isRRRA() && psectlotag == ST_18_ELEVATOR_DOWN)) @@ -3370,9 +3371,6 @@ void processinput_r(int snum) setForcedSyncInput(); } - //Do the quick lefts and rights - p->Angles.doViewYaw(&p->sync); - if (movementBlocked(p)) { doubvel = 0; @@ -3389,7 +3387,6 @@ void processinput_r(int snum) p->GetActor()->spr.Angles.Yaw += p->adjustavel(PlayerInputAngVel(snum)); } - p->Angles.doYawKeys(&p->sync); purplelavacheck(p); if (p->spritebridge == 0 && pact->insector()) @@ -3535,10 +3532,8 @@ void processinput_r(int snum) } HORIZONLY: - double iif = 40; - if (psectlotag == 1 || p->spritebridge == 1) iif = 4; - else iif = 20; + double iif = (psectlotag == 1 || p->spritebridge == 1) ? 4 : 20; if (p->insector() && p->cursector->lotag == 2) k = 0; else k = 1; @@ -3661,6 +3656,7 @@ HORIZONLY: if (p->cursector != pact->sector()) ChangeActorSect(pact, p->cursector); + auto oldpos = p->GetActor()->opos; int retry = 0; while (ud.clipping == 0) { @@ -3727,15 +3723,15 @@ HORIZONLY: p->GetActor()->spr.Angles.Pitch += maphoriz(d); } + p->Angles.doPitchKeys(&p->sync); + + p->checkhardlanding(); + if (SyncInput()) { p->GetActor()->spr.Angles.Pitch += GetPlayerHorizon(snum); } - p->Angles.doPitchKeys(&p->sync); - - p->checkhardlanding(); - //Shooting code/changes if (p->show_empty_weapon > 0)