mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +00:00
- Fixed: Player pitch limits were reset to 0 when changing levels and loading
saved games. SVN r3332 (trunk)
This commit is contained in:
parent
b1905c16ef
commit
7279e2ad62
4 changed files with 29 additions and 6 deletions
|
@ -256,6 +256,7 @@ public:
|
|||
|
||||
void SetLogNumber (int num);
|
||||
void SetLogText (const char *text);
|
||||
void SendPitchLimits() const;
|
||||
|
||||
APlayerPawn *mo;
|
||||
BYTE playerstate;
|
||||
|
@ -283,6 +284,7 @@ public:
|
|||
bool centering;
|
||||
BYTE turnticks;
|
||||
|
||||
|
||||
bool attackdown;
|
||||
bool usedown;
|
||||
DWORD oldbuttons;
|
||||
|
|
|
@ -666,6 +666,7 @@ void G_DoCompleted (void)
|
|||
{
|
||||
|
||||
|
||||
|
||||
level_info_t *nextinfo = FindLevelInfo (nextlevel);
|
||||
wminfo.next = nextinfo->mapname;
|
||||
wminfo.LName1 = TexMan[TexMan.CheckForTexture(nextinfo->pname, FTexture::TEX_MiscPatch)];
|
||||
|
@ -1148,6 +1149,7 @@ void G_FinishTravel ()
|
|||
pawn->LinkToWorld ();
|
||||
pawn->AddToHash ();
|
||||
pawn->SetState(pawn->SpawnState);
|
||||
pawn->player->SendPitchLimits();
|
||||
|
||||
for (inv = pawn->Inventory; inv != NULL; inv = inv->Inventory)
|
||||
{
|
||||
|
|
|
@ -112,6 +112,8 @@ void P_SerializePlayers (FArchive &arc, bool skipload)
|
|||
{
|
||||
SpawnExtraPlayers ();
|
||||
}
|
||||
// Redo pitch limits, since the spawned player has them at 0.
|
||||
players[consoleplayer].SendPitchLimits();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -408,6 +408,26 @@ int player_t::GetSpawnClass()
|
|||
return static_cast<APlayerPawn*>(GetDefaultByType(type))->SpawnMask;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// player_t :: SendPitchLimits
|
||||
//
|
||||
// Ask the local player's renderer what pitch restrictions should be imposed
|
||||
// and let everybody know. Only sends data for the consoleplayer, since the
|
||||
// local player is the only one our data is valid for.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void player_t::SendPitchLimits() const
|
||||
{
|
||||
if (this - players == consoleplayer)
|
||||
{
|
||||
Net_WriteByte(DEM_SETPITCHLIMIT);
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(false)); // up
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(true)); // down
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APlayerPawn
|
||||
|
@ -522,13 +542,9 @@ void APlayerPawn::PostBeginPlay()
|
|||
P_FindFloorCeiling(this, true);
|
||||
z = floorz;
|
||||
}
|
||||
else if (player - players == consoleplayer)
|
||||
else
|
||||
{
|
||||
// Ask the local player's renderer what pitch restrictions
|
||||
// should be imposed and let everybody know.
|
||||
Net_WriteByte(DEM_SETPITCHLIMIT);
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(false)); // up
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(true)); // down
|
||||
player->SendPitchLimits();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2505,6 +2521,7 @@ void P_UnPredictPlayer ()
|
|||
{
|
||||
player_t *player = &players[consoleplayer];
|
||||
|
||||
|
||||
if (player->cheats & CF_PREDICTING)
|
||||
{
|
||||
AActor *act = player->mo;
|
||||
|
|
Loading…
Reference in a new issue