1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fixed init of playerInfo. Fixes crash during save game where not all 8 players are present.

This commit is contained in:
Frank Zago
2009-05-29 03:53:53 +00:00
parent 566a99932b
commit 7a89b33ab7
2 changed files with 5 additions and 1 deletions

View File

@@ -262,7 +262,6 @@ void CMapHeader::loadPlayerInfo( int &pom, unsigned char * bufor, int &i )
players[pom].canComputerPlay = bufor[i++];
if ((!(players[pom].canHumanPlay || players[pom].canComputerPlay)))
{
memset(&players[pom],0,sizeof(PlayerInfo));
switch(version)
{
case SoD: case WoG:

View File

@@ -122,6 +122,11 @@ struct DLL_EXPORT PlayerInfo
ui8 team;
ui8 generateHero;
PlayerInfo(): p7(0), p8(0), p9(0), canHumanPlay(0), canComputerPlay(0),
AITactic(0), allowedFactions(0), isFactionRandom(0),
mainHeroPortrait(0), hasMainTown(0), generateHeroAtMainTown(0),
team(0), generateHero(0) {};
template <typename Handler> void serialize(Handler &h, const int version)
{
h & p7 & p8 & p9 & canHumanPlay & canComputerPlay & AITactic & allowedFactions & isFactionRandom &