Skip to content

Commit

Permalink
libcommon|Hexen: Do not write the in-game player map with the game sa…
Browse files Browse the repository at this point in the history
…ve header

This data is already written elsewhere in the ASEG_PLAYERS segment.
  • Loading branch information
danij-deng committed Jun 22, 2012
1 parent 7306590 commit 8c5a81d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doomsday/plugins/common/include/p_saveio.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
typedef struct saveheader_s {
int magic;
int version;
gamemode_t gameMode; // Presently unused in Hexen.
gamemode_t gameMode;
char name[SAVESTRINGSIZE];
byte skill;
byte episode;
Expand All @@ -44,8 +44,8 @@ typedef struct saveheader_s {
#else
byte respawnMonsters;
int mapTime;
#endif
byte players[MAXPLAYERS];
#endif
unsigned int gameId;
} saveheader_t;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/p_saveg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4538,13 +4538,13 @@ static void writeSaveHeader(const char* saveName)
#else
hdr.respawnMonsters = respawnMonsters;
hdr.mapTime = mapTime;
#endif
hdr.gameId = SV_GenerateGameId();
{ int i;
for(i = 0; i < MAXPLAYERS; i++)
{
hdr.players[i] = players[i].plr->inGame;
}}
#endif

SV_SaveInfo_Write(&hdr);
}
Expand Down
10 changes: 3 additions & 7 deletions doomsday/plugins/common/src/p_saveio.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,12 @@ void SaveInfo_Write(saveheader_t* info, Writer* writer)
#else
Writer_WriteByte(writer, info->respawnMonsters);
Writer_WriteInt32(writer, info->mapTime);
#endif
{ int i;
for(i = 0; i < MAXPLAYERS; ++i)
{
Writer_WriteByte(writer, info->players[i]);
}}
#endif
Writer_WriteInt32(writer, info->gameId);
}

Expand Down Expand Up @@ -927,13 +927,13 @@ void SaveInfo_Read(saveheader_t* info, Reader* reader)
if(info->version < 10) SV_Seek(2);

info->mapTime = Reader_ReadInt32(reader);
#endif

{ int i;
for(i = 0; i < MAXPLAYERS; ++i)
{
info->players[i] = Reader_ReadByte(reader);
}}
#endif

info->gameId = Reader_ReadInt32(reader);

// Translate gameMode identifiers from older save versions.
Expand Down Expand Up @@ -978,10 +978,6 @@ void SaveInfo_Read_Hx_v9(saveheader_t* info, Reader* reader)
info->gameMode = gameMode; // Assume the current mode.
info->gameId = 0; // None.

// Assume only one player.
memset(info->players, 0, sizeof(info->players));
info->players[0] = 1;

# undef HXS_VERSION_TEXT_LENGTH
# undef HXS_VERSION_TEXT
}
Expand Down

0 comments on commit 8c5a81d

Please sign in to comment.