[Scummvm-git-logs] scummvm master -> a37f0b951d09b504a70bdfc342b1778974c37536
OMGPizzaGuy
noreply at scummvm.org
Sat Dec 3 20:00:45 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1a4a6c504d ULTIMA8: Restore unsupported save version check and set minimum version
a37f0b951d ULTIMA8: Remove save description annotations from save diary gump
Commit: 1a4a6c504daf7582d5683bf5c40e4b6d935ae556
https://github.com/scummvm/scummvm/commit/1a4a6c504daf7582d5683bf5c40e4b6d935ae556
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-03T14:00:23-06:00
Commit Message:
ULTIMA8: Restore unsupported save version check and set minimum version
Pentagam's version check allows any version greater than the first, so we set the minimum version to 2
Changed paths:
engines/ultima/ultima8/filesys/savegame.cpp
engines/ultima/ultima8/ultima8.cpp
diff --git a/engines/ultima/ultima8/filesys/savegame.cpp b/engines/ultima/ultima8/filesys/savegame.cpp
index 495b7320ce8..3f18ec0a641 100644
--- a/engines/ultima/ultima8/filesys/savegame.cpp
+++ b/engines/ultima/ultima8/filesys/savegame.cpp
@@ -26,6 +26,7 @@ namespace Ultima8 {
#define SAVEGAME_IDENT MKTAG('V', 'M', 'U', '8')
#define SAVEGAME_VERSION 5
+#define SAVEGAME_MIN_VERSION 2
SavegameReader::SavegameReader(Common::SeekableReadStream *rs, bool metadataOnly) : _file(rs), _version(0) {
if (!MetaEngine::readSavegameHeader(rs, &_header))
@@ -63,12 +64,12 @@ SavegameReader::~SavegameReader() {
SavegameReader::State SavegameReader::isValid() const {
if (_version == 0)
return SAVE_CORRUPT;
- else if (_version < SAVEGAME_VERSION)
+ else if (_version < SAVEGAME_MIN_VERSION)
return SAVE_OUT_OF_DATE;
else if (_version > SAVEGAME_VERSION)
return SAVE_TOO_RECENT;
- else
- return SAVE_VALID;
+
+ return SAVE_VALID;
}
Common::SeekableReadStream *SavegameReader::getDataSource(const Std::string &name) {
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 34f1c515b1b..cbfd97e64a8 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -1265,6 +1265,11 @@ Common::Error Ultima8Engine::loadGameStream(Common::SeekableReadStream *stream)
return Common::kReadingFailed;
}
+ if (state != SavegameReader::SAVE_VALID) {
+ Error("Unsupported savegame version", "Error Loading savegame");
+ delete sg;
+ return Common::kReadingFailed;
+ }
_mouse->pushMouseCursor();
_mouse->setMouseCursor(Mouse::MOUSE_PENTAGRAM);
Commit: a37f0b951d09b504a70bdfc342b1778974c37536
https://github.com/scummvm/scummvm/commit/a37f0b951d09b504a70bdfc342b1778974c37536
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-03T14:00:23-06:00
Commit Message:
ULTIMA8: Remove save description annotations from save diary gump
These annotations are not available in the save/load dialog and do not provide much utility to the user as unsupported saves generate an error on load.
Changed paths:
engines/ultima/ultima8/gumps/u8_save_gump.cpp
diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index d8b37dac271..242ce8a2820 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -290,27 +290,7 @@ void U8SaveGump::loadDescriptions() {
continue;
const SavegameReader *sg = new SavegameReader(saveFile, true);
- SavegameReader::State state = sg->isValid();
- _descriptions[i] = "";
-
- // FIXME: move version checks elsewhere!!
- switch (state) {
- case SavegameReader::SAVE_CORRUPT:
- _descriptions[i] = Common::convertFromU32String(_("[corrupt]"));
- break;
- case SavegameReader::SAVE_OUT_OF_DATE:
- _descriptions[i] = Common::convertFromU32String(_("[outdated]"));
- break;
- case SavegameReader::SAVE_TOO_RECENT:
- _descriptions[i] = Common::convertFromU32String(_("[too modern]"));
- break;
- default:
- break;
- }
-
- if (state != SavegameReader::SAVE_VALID)
- _descriptions[i] += " ";
- _descriptions[i] += sg->getDescription();
+ _descriptions[i] = sg->getDescription();
delete sg;
}
}
More information about the Scummvm-git-logs
mailing list