- SW: Ensure save code backs up crouch_toggle and player's current input.

* Fixes #166.
This commit is contained in:
Mitchell Richters 2020-11-12 23:31:32 +11:00
parent 70b75f72b5
commit 735d89bfb6
2 changed files with 6 additions and 4 deletions

View file

@ -71,12 +71,12 @@ const char *GetVersionString();
#define MINSAVEVER_DN3D 10 #define MINSAVEVER_DN3D 10
#define MINSAVEVER_BLD 10 #define MINSAVEVER_BLD 10
#define MINSAVEVER_SW 10 #define MINSAVEVER_SW 11
#define MINSAVEVER_PS 10 #define MINSAVEVER_PS 10
#define SAVEVER_DN3D 10 #define SAVEVER_DN3D 10
#define SAVEVER_BLD 10 #define SAVEVER_BLD 10
#define SAVEVER_SW 10 #define SAVEVER_SW 11
#define SAVEVER_PS 10 #define SAVEVER_PS 10
#define NETGAMEVERSION 1 #define NETGAMEVERSION 1

View file

@ -234,6 +234,7 @@ bool GameInterface::SaveGame()
MWRITE(&myconnectindex,sizeof(myconnectindex),1,fil); MWRITE(&myconnectindex,sizeof(myconnectindex),1,fil);
MWRITE(&connecthead,sizeof(connecthead),1,fil); MWRITE(&connecthead,sizeof(connecthead),1,fil);
MWRITE(connectpoint2,sizeof(connectpoint2),1,fil); MWRITE(connectpoint2,sizeof(connectpoint2),1,fil);
MWRITE(&crouch_toggle,sizeof(crouch_toggle),1,fil);
//save players info //save players info
pp = &tp; pp = &tp;
@ -464,7 +465,7 @@ bool GameInterface::SaveGame()
MWRITE(Track[i].TrackPoint, Track[i].NumPoints * sizeof(TRACK_POINT),1,fil); MWRITE(Track[i].TrackPoint, Track[i].NumPoints * sizeof(TRACK_POINT),1,fil);
} }
// MWRITE(&loc,sizeof(loc),1,fil); MWRITE(&Player[myconnectindex].input,sizeof(Player[myconnectindex].input),1,fil);
MWRITE(&screenpeek,sizeof(screenpeek),1,fil); MWRITE(&screenpeek,sizeof(screenpeek),1,fil);
MWRITE(&randomseed, sizeof(randomseed), 1, fil); MWRITE(&randomseed, sizeof(randomseed), 1, fil);
@ -669,6 +670,7 @@ bool GameInterface::LoadGame()
MREAD(&myconnectindex,sizeof(myconnectindex),1,fil); MREAD(&myconnectindex,sizeof(myconnectindex),1,fil);
MREAD(&connecthead,sizeof(connecthead),1,fil); MREAD(&connecthead,sizeof(connecthead),1,fil);
MREAD(connectpoint2,sizeof(connectpoint2),1,fil); MREAD(connectpoint2,sizeof(connectpoint2),1,fil);
MREAD(&crouch_toggle,sizeof(crouch_toggle),1,fil);
//save players //save players
//MREAD(Player,sizeof(PLAYER), numplayers,fil); //MREAD(Player,sizeof(PLAYER), numplayers,fil);
@ -847,7 +849,7 @@ bool GameInterface::LoadGame()
} }
} }
// MREAD(&loc,sizeof(loc),1,fil); MREAD(&Player[myconnectindex].input,sizeof(Player[myconnectindex].input),1,fil);
MREAD(&screenpeek,sizeof(screenpeek),1,fil); MREAD(&screenpeek,sizeof(screenpeek),1,fil);
MREAD(&randomseed, sizeof(randomseed), 1, fil); MREAD(&randomseed, sizeof(randomseed), 1, fil);