From 735d89bfb69c6bc3c6578a9d9a6a8b400d424b94 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 12 Nov 2020 23:31:32 +1100 Subject: [PATCH] - SW: Ensure save code backs up `crouch_toggle` and player's current input. * Fixes #166. --- source/core/version.h | 4 ++-- source/sw/src/save.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/core/version.h b/source/core/version.h index 5da66c748..5f34ff427 100644 --- a/source/core/version.h +++ b/source/core/version.h @@ -71,12 +71,12 @@ const char *GetVersionString(); #define MINSAVEVER_DN3D 10 #define MINSAVEVER_BLD 10 -#define MINSAVEVER_SW 10 +#define MINSAVEVER_SW 11 #define MINSAVEVER_PS 10 #define SAVEVER_DN3D 10 #define SAVEVER_BLD 10 -#define SAVEVER_SW 10 +#define SAVEVER_SW 11 #define SAVEVER_PS 10 #define NETGAMEVERSION 1 diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index 51b26950e..a1d527b5f 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -234,6 +234,7 @@ bool GameInterface::SaveGame() MWRITE(&myconnectindex,sizeof(myconnectindex),1,fil); MWRITE(&connecthead,sizeof(connecthead),1,fil); MWRITE(connectpoint2,sizeof(connectpoint2),1,fil); + MWRITE(&crouch_toggle,sizeof(crouch_toggle),1,fil); //save players info pp = &tp; @@ -464,7 +465,7 @@ bool GameInterface::SaveGame() 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(&randomseed, sizeof(randomseed), 1, fil); @@ -669,6 +670,7 @@ bool GameInterface::LoadGame() MREAD(&myconnectindex,sizeof(myconnectindex),1,fil); MREAD(&connecthead,sizeof(connecthead),1,fil); MREAD(connectpoint2,sizeof(connectpoint2),1,fil); + MREAD(&crouch_toggle,sizeof(crouch_toggle),1,fil); //save players //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(&randomseed, sizeof(randomseed), 1, fil);