From e433aeccbbd4d956c86b391f39f1f1b1837fcfa5 Mon Sep 17 00:00:00 2001 From: Michael Werle Date: Fri, 18 Oct 2024 16:06:44 +0900 Subject: [PATCH] fix: remove duplicate call to LoadGameToJson A duplicate call to LoadGameToJson() snuck past the developer and reviewers in SaveGameManager::LoadGame(). Replace the duplicate call by the local variable which already contains the loaded game. --- src/SaveGameManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SaveGameManager.cpp b/src/SaveGameManager.cpp index 18ecd4253c..fe27e802da 100644 --- a/src/SaveGameManager.cpp +++ b/src/SaveGameManager.cpp @@ -96,7 +96,7 @@ Game *SaveGameManager::LoadGame(const std::string &name) if (!rootNode.is_object()) { throw SavedGameCorruptException(); } - return new Game(LoadGameToJson(name)); + return new Game(rootNode); } catch (const Json::type_error &) { throw SavedGameCorruptException(); } catch (const Json::out_of_range &) {