Skip to content

Commit

Permalink
Automatically adding .json extension to savegames now, fixed levelswitch
Browse files Browse the repository at this point in the history
  • Loading branch information
ataulien committed Dec 22, 2016
1 parent c24ca52 commit 6b585c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/target/REGoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class ExampleCubes : public /*entry::AppI*/ PLATFORM_CLASS
std::string savegame = "";


std::string file = args[1];
std::string file = args[1] + ".json";
if (!Utils::fileExists(file))
return "File '" + file + "' not found.";

Expand All @@ -455,11 +455,11 @@ class ExampleCubes : public /*entry::AppI*/ PLATFORM_CLASS
m_pEngine->getMainWorld().get().exportWorld(j);

// Save
std::ofstream f(args[1]);
std::ofstream f(args[1] + ".json");
f << Utils::iso_8859_1_to_utf8(j.dump(4));
f.close();

return "World saved to file: " + args[1];
return "World saved to file: " + args[1] + ".json";
});

console.registerCommand("knockout", [this](const std::vector<std::string>& args) -> std::string {
Expand Down

0 comments on commit 6b585c8

Please sign in to comment.