diff --git a/source/core/gameinput.h b/source/core/gameinput.h index a2e7c8e65..e07f0248e 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -88,9 +88,6 @@ struct PlayerAngles return offsets; } - // Pitch methods. - void setPitch(const DAngle value, const bool backup = false) { updateAngle(PITCH, ClampViewPitch(value), backup); } - // Yaw methods. void setYaw(const DAngle value, const bool backup = false) { updateAngle(YAW, value, backup); } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 870f86dd4..bb2428bf7 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -2187,7 +2187,7 @@ void trPlayerCtrlSetLookAngle(int value, PLAYER* pPlayer) if (const double adjustment = clamp(value * 0.125 * (value > 0 ? lookStepUp : lookStepDown), downAngle, upAngle)) { setForcedSyncInput(); - pPlayer->Angles.setPitch(maphoriz(-100. * tan(adjustment * pi::pi() * (1. / 1024.)))); + pPlayer->actor->spr.Angles.Pitch = maphoriz(-100. * tan(adjustment * pi::pi() * (1. / 1024.))); } } diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 7e8adaadf..b7a0ce7c8 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -344,7 +344,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, { ps[iPlayer].sync.actions &= ~SB_CENTERVIEW; } - ps[iPlayer].Angles.setPitch(maphoriz(-lValue)); + ps[iPlayer].GetActor()->spr.Angles.Pitch = maphoriz(-lValue); } else SetGameVarID(lVar2, int(ps[iPlayer].GetActor()->spr.Angles.Pitch.Tan() * -128.), sActor, sPlayer); break; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index d1c54ee4d..087e67993 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3880,7 +3880,7 @@ void OnMotorcycle(player_struct *p) p->gotweapon[MOTORCYCLE_WEAPON] = true; p->vel.X = 0; p->vel.Y = 0; - p->Angles.setPitch(nullAngle); + p->GetActor()->spr.Angles.Pitch = nullAngle; } if (!S_CheckActorSoundPlaying(p->GetActor(),186)) S_PlayActorSound(186, p->GetActor()); @@ -3911,7 +3911,7 @@ void OffMotorcycle(player_struct *p) p->gotweapon[MOTORCYCLE_WEAPON] = false; p->curr_weapon = p->last_full_weapon; checkavailweapon(p); - p->Angles.setPitch(nullAngle); + p->GetActor()->spr.Angles.Pitch = nullAngle; p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; @@ -3947,7 +3947,7 @@ void OnBoat(player_struct *p) p->gotweapon[BOAT_WEAPON] = true; p->vel.X = 0; p->vel.Y = 0; - p->Angles.setPitch(nullAngle); + p->GetActor()->spr.Angles.Pitch = nullAngle; } } @@ -3965,7 +3965,7 @@ void OffBoat(player_struct *p) p->gotweapon[BOAT_WEAPON] = false; p->curr_weapon = p->last_full_weapon; checkavailweapon(p); - p->Angles.setPitch(nullAngle); + p->GetActor()->spr.Angles.Pitch = nullAngle; p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 4a4ca2e5f..d0c612159 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1069,11 +1069,8 @@ void AIPlayer::Tick(RunListEvent* ev) { if (nTotalPlayers <= 1) { - auto ang = GetAngleToSprite(pPlayerActor, pSpiritSprite); - PlayerList[nPlayer].Angles.setYaw(ang, true); - pPlayerActor->spr.Angles.Yaw = ang; - - PlayerList[nPlayer].Angles.setPitch(nullAngle, true); + pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle); + pPlayerActor->backupang(); sPlayerInput[nPlayer].vel.Zero(); pPlayerActor->vel.Zero(); @@ -1086,7 +1083,7 @@ void AIPlayer::Tick(RunListEvent* ev) InitSpiritHead(); PlayerList[nPlayer].nDestVertPan = nullAngle; - PlayerList[nPlayer].Angles.setPitch(currentLevel->ex_ramses_horiz); + pPlayerActor->spr.Angles.Pitch = currentLevel->ex_ramses_horiz; } } else @@ -2616,7 +2613,7 @@ sectdone: { if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0) { - PlayerList[nPlayer].Angles.setPitch(nullAngle); + pPlayerActor->spr.Angles.Pitch = nullAngle; pPlayerActor->viewzoffset -= dVertPan[nPlayer]; } else @@ -2625,7 +2622,7 @@ sectdone: if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= 38) { - PlayerList[nPlayer].Angles.setPitch(DAngle::fromDeg(-37.72)); + PlayerList[nPlayer].pActor->spr.Angles.Pitch = DAngle::fromDeg(-37.72); } else if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() >= 0) {