Fix crash when viewing record with more than 2 players (#1228)

issue1247
Armin Burgmeier 2015-01-12 16:37:51 -05:00
parent ae5f56594a
commit 57878a0604
1 changed files with 3 additions and 2 deletions

View File

@ -630,8 +630,9 @@ bool C4Viewport::Init(int32_t iPlayer, bool fSetTempOnly)
// Owned viewport: clear any flash message explaining observer menu
if (ValidPlr(iPlayer)) ::GraphicsSystem.FlashMessage("");
}
// Initialize FoW
assert(pFoW == NULL);
// Initialize FoW -- note that Init() can be called multiple times to
// change the player this viewport is showing.
if (pFoW == NULL) { delete pFoW; pFoW = NULL; }
if (::Landscape.pFoW && Player != NO_OWNER)
pFoW = new C4FoWRegion(::Landscape.pFoW, ::Players.Get(iPlayer));
return true;