Skip to content

Commit

Permalink
fix: remove duplicate call to LoadGameToJson
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mwerle authored and impaktor committed Oct 18, 2024
1 parent 61f1c16 commit 9cf9a6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SaveGameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &) {
Expand Down

0 comments on commit 9cf9a6b

Please sign in to comment.