- Fixed: Player pitch limits were reset to 0 when changing levels and loading

saved games.



SVN r3332 (trunk)
This commit is contained in:
Randy Heit 2011-12-14 00:16:19 +00:00
commit 7279e2ad62
4 changed files with 29 additions and 6 deletions

View file

@ -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;