[Scummvm-git-logs] scummvm master -> f9f08d57bcda952a109b96dab0c3a4b4c2a208b1

dreammaster noreply at scummvm.org
Tue May 12 06:18:13 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
f9f08d57bc MADS: PHANTOM: Add savegame version byte


Commit: f9f08d57bcda952a109b96dab0c3a4b4c2a208b1
    https://github.com/scummvm/scummvm/commit/f9f08d57bcda952a109b96dab0c3a4b4c2a208b1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-12T16:17:55+10:00

Commit Message:
MADS: PHANTOM: Add savegame version byte

Changed paths:
    engines/mads/madsv2/engine.cpp


diff --git a/engines/mads/madsv2/engine.cpp b/engines/mads/madsv2/engine.cpp
index 500745a33ff..25c69ae5aa6 100644
--- a/engines/mads/madsv2/engine.cpp
+++ b/engines/mads/madsv2/engine.cpp
@@ -57,6 +57,7 @@
 namespace MADS {
 namespace MADSV2 {
 
+constexpr int SAVEGAME_VERSION = 1;
 constexpr int GAME_FRAME_RATE = 50;
 constexpr int GAME_FRAME_TIME = 1000 / GAME_FRAME_RATE;
 
@@ -128,8 +129,11 @@ bool MADSV2Engine::canLoadGameStateCurrently(Common::U32String *msg) {
 }
 
 Common::Error MADSV2Engine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
-	// Sync main game data
+	stream->writeByte(SAVEGAME_VERSION);
 	Common::Serializer s(nullptr, stream);
+	s.setVersion(SAVEGAME_VERSION);
+
+	// Sync main game data
 	syncGame(s);
 
 	// Save conversation data
@@ -141,6 +145,11 @@ Common::Error MADSV2Engine::saveGameStream(Common::WriteStream *stream, bool isA
 Common::Error MADSV2Engine::loadGameStream(Common::SeekableReadStream *stream) {
 	int save = player.walker_is_loaded;
 
+	byte version = stream->readByte();
+	if (version != SAVEGAME_VERSION)
+		error("Invalid savegame version");
+
+
 	// Sync main game data
 	Common::Serializer s(stream, nullptr);
 	syncGame(s);




More information about the Scummvm-git-logs mailing list