From 84e99ae652662dfb32294cd9034666af9cf47e76 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 23 Nov 2013 10:18:04 +0100 Subject: AVALANCHE: Fix savegames compatibility before/after Nim implementation --- engines/avalanche/avalanche.h | 2 +- engines/avalanche/nim.cpp | 3 +++ engines/avalanche/parser.cpp | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index fac17df6e3..87eb3c2158 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -60,7 +60,7 @@ struct AvalancheGameDescription { ADGameDescription desc; }; -static const int kSavegameVersion = 1; +static const int kSavegameVersion = 2; enum Pitch { kPitchInvalid, diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp index faca3e491d..d066ffc3e8 100644 --- a/engines/avalanche/nim.cpp +++ b/engines/avalanche/nim.cpp @@ -43,6 +43,9 @@ void Nim::resetVariables() { } void Nim::synchronize(Common::Serializer &sz) { + if (sz.isLoading() && sz.getVersion() < 2) + return; + sz.syncAsByte(_playedNim); } diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index a77a71d157..f43ba61dcf 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -2471,6 +2471,10 @@ void Parser::synchronize(Common::Serializer &sz) { sz.syncAsByte(_wearing); sz.syncAsByte(_sworeNum); sz.syncAsByte(_alcoholLevel); + if (sz.isLoading() && sz.getVersion() < 2) { + int dummy; + sz.syncAsByte(dummy); + } sz.syncAsByte(_boughtOnion); } -- cgit v1.2.3