diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 16fee6d1..82b27995 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -1918,16 +1918,15 @@ void Game::updatestate() } else { - savetele(); - if (graphics.flipmode) + if (savetele()) { - graphics.createtextbox(" Game Saved ", -1, 202, 174, 174, 174); + graphics.createtextbox(" Game Saved ", -1, graphics.flipmode ? 202 : 12, 174, 174, 174); graphics.textboxtimer(25); } else { - graphics.createtextbox(" Game Saved ", -1, 12, 174, 174, 174); - graphics.textboxtimer(25); + graphics.createtextbox(" ERROR: Could not save game! ", -1, graphics.flipmode ? 202 : 12, 255, 60, 60); + graphics.textboxtimer(50); } state = 0; } @@ -5698,12 +5697,12 @@ void Game::initteleportermode() } } -void Game::savetele() +bool Game::savetele() { if (map.custommode || inspecial()) { //Don't trash save data! - return; + return false; } tinyxml2::XMLDocument doc; @@ -5714,15 +5713,14 @@ void Game::savetele() } telesummary = writemaingamesave(doc); - if(FILESYSTEM_saveTiXml2Document("saves/tsave.vvv", doc)) - { - printf("Game saved\n"); - } - else + if(!FILESYSTEM_saveTiXml2Document("saves/tsave.vvv", doc)) { printf("Could Not Save game!\n"); printf("Failed: %s%s\n", saveFilePath.c_str(), "tsave.vvv"); + return false; } + printf("Game saved\n"); + return true; } diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 4ad44a14..6597a016 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -132,7 +132,7 @@ public: void deletequick(); - void savetele(); + bool savetele(); void loadtele(); diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 83eacbc6..9fda1a2b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3552,17 +3552,16 @@ void scriptclass::teleport() } if (!game.intimetrial && !game.nodeathmode && !game.inintermission) { - if (graphics.flipmode) + if (game.savetele()) { - graphics.createtextbox(" Game Saved ", -1, 202, 174, 174, 174); + graphics.createtextbox(" Game Saved ", -1, graphics.flipmode ? 202 : 12, 174, 174, 174); graphics.textboxtimer(25); } else { - graphics.createtextbox(" Game Saved ", -1, 12, 174, 174, 174); - graphics.textboxtimer(25); + graphics.createtextbox(" ERROR: Could not save game! ", -1, graphics.flipmode ? 202 : 12, 255, 60, 60); + graphics.textboxtimer(50); } - game.savetele(); } } }