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

LubomirR lubomirr at lubomirr.eu
Thu Sep 6 20:39:42 CEST 2018


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

Summary:
c239a18620 MUTATIONOFJB: Small fixes.


Commit: c239a18620a9ecbfc0a160647263aa59180112df
    https://github.com/scummvm/scummvm/commit/c239a18620a9ecbfc0a160647263aa59180112df
Author: Ľubomír Remák (lubomirr at lubomirr.eu)
Date: 2018-09-06T20:38:33+02:00

Commit Message:
MUTATIONOFJB: Small fixes.

Handle errors in save/load code.
Fix typo in Game::colorFromString.

Changed paths:
    engines/mutationofjb/game.cpp
    engines/mutationofjb/gamedata.h
    engines/mutationofjb/mutationofjb.cpp


diff --git a/engines/mutationofjb/game.cpp b/engines/mutationofjb/game.cpp
index 5e0d1e6..86755b1 100644
--- a/engines/mutationofjb/game.cpp
+++ b/engines/mutationofjb/game.cpp
@@ -212,7 +212,7 @@ uint8 Game::colorFromString(const char *colorStr) {
 		uint8 color;
 	} colors[] = {
 		{"white", WHITE},
-		{"dakrgray", DARKGRAY},
+		{"darkgray", DARKGRAY},
 		{"lightgray", LIGHTGRAY},
 		{"green", GREEN},
 		{"orange", ORANGE},
diff --git a/engines/mutationofjb/gamedata.h b/engines/mutationofjb/gamedata.h
index 3ba859b..f42e84b 100644
--- a/engines/mutationofjb/gamedata.h
+++ b/engines/mutationofjb/gamedata.h
@@ -50,8 +50,6 @@ enum {
  * An interactable scene changer with no visual representation.
  */
 struct Door : public Common::Serializable {
-	virtual ~Door() {}
-
 	/**
 	 * Door name (NM register).
 	 *
diff --git a/engines/mutationofjb/mutationofjb.cpp b/engines/mutationofjb/mutationofjb.cpp
index 84ef974..ed4608b 100644
--- a/engines/mutationofjb/mutationofjb.cpp
+++ b/engines/mutationofjb/mutationofjb.cpp
@@ -141,6 +141,8 @@ bool MutationOfJBEngine::canLoadGameStateCurrently() {
 Common::Error MutationOfJBEngine::loadGameState(int slot) {
 	const Common::String saveName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
 	Common::InSaveFile *const saveFile = g_system->getSavefileManager()->openForLoading(saveName);
+	if (!saveFile)
+		return Common::kReadingFailed;
 
 	Common::Serializer sz(saveFile, nullptr);
 
@@ -162,6 +164,8 @@ bool MutationOfJBEngine::canSaveGameStateCurrently() {
 Common::Error MutationOfJBEngine::saveGameState(int slot, const Common::String &desc) {
 	const Common::String saveName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
 	Common::OutSaveFile *const saveFile = g_system->getSavefileManager()->openForSaving(saveName);
+	if (!saveFile)
+		return Common::kWritingFailed;
 
 	Common::Serializer sz(nullptr, saveFile);
 
@@ -295,7 +299,9 @@ Common::Error MutationOfJBEngine::run() {
 	setupCursor();
 
 	if (ConfMan.hasKey("save_slot")) {
-		loadGameState(ConfMan.getInt("save_slot"));
+		const Common::Error err = loadGameState(ConfMan.getInt("save_slot"));
+		if (err.getCode() != Common::kNoError)
+			return err;
 	} else {
 		_game->changeScene(13, false); // Initial scene.
 	}





More information about the Scummvm-git-logs mailing list