]> git.localhorst.tv Git - blank.git/blobdiff - src/io/WorldSave.cpp
move common exceptions to app/error
[blank.git] / src / io / WorldSave.cpp
index d483c915939407426fbab0d4a7c70387a9a11bce..529d0d91a5784da2f1cf2cea55ae62a1fc87b75c 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "filesystem.hpp"
 #include "TokenStreamReader.hpp"
+#include "../app/error.hpp"
 
 #include <cctype>
 #include <cstring>
@@ -144,6 +145,7 @@ void WorldSave::Read(Player &player) const {
                }
        }
        player.GetEntity().SetState(state);
+       player.Update(0);
 }
 
 void WorldSave::Write(const Player &player) const {
@@ -195,7 +197,7 @@ void WorldSave::Write(Chunk &chunk) const {
                // check if it's because of a missing path component
                if (errno != ENOENT) {
                        // nope, fatal
-                       throw runtime_error(strerror(errno));
+                       throw SysError();
                }
                string dir_path(path);
                dir_path.erase(dir_path.find_last_of("\\/"));