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:
@@ -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:
|
||||
|
@@ -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 &
|
||||
|
Reference in New Issue
Block a user