Initialize new player viewports with proper zoom and zoom limits (#1419).

shapetextures
Sven Eberhardt 2015-10-10 21:46:55 -04:00
parent ce505a04ae
commit 2a31fe72f8
1 changed files with 7 additions and 0 deletions

View File

@ -875,6 +875,13 @@ bool C4ViewportList::CreateViewport(int32_t iPlayer, bool fSilent)
RecalculateViewports();
// Viewports start off at centered position
nvp->CenterPosition();
// Initial player zoom values to viewport (in case they were set early in InitializePlayer, loaded from savegame, etc.)
C4Player *plr = ::Players.Get(iPlayer);
if (plr)
{
plr->ZoomToViewport(nvp, true, false, false);
plr->ZoomLimitsToViewport(nvp);
}
// Action sound
if (GetViewportCount()!=iLastCount) if (!fSilent)
StartSoundEffect("CloseViewport");