X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fio%2FWorldSave.cpp;h=529d0d91a5784da2f1cf2cea55ae62a1fc87b75c;hb=1a8974bcfeb6f6c937f2ec523e52fdc4a3785f1e;hp=8422623f36746262f30e10f0d78942a44f635439;hpb=4727825186798902f68df5b99a6a32f0ef618454;p=blank.git diff --git a/src/io/WorldSave.cpp b/src/io/WorldSave.cpp index 8422623..529d0d9 100644 --- a/src/io/WorldSave.cpp +++ b/src/io/WorldSave.cpp @@ -2,6 +2,7 @@ #include "filesystem.hpp" #include "TokenStreamReader.hpp" +#include "../app/error.hpp" #include #include @@ -144,6 +145,7 @@ void WorldSave::Read(Player &player) const { } } player.GetEntity().SetState(state); + player.Update(0); } void WorldSave::Write(const Player &player) const { @@ -183,6 +185,7 @@ void WorldSave::Read(Chunk &chunk) const { if (gzclose(file) != Z_OK) { throw runtime_error("failed to read chunk file"); } + chunk.ScanActive(); chunk.InvalidateMesh(); chunk.ClearSave(); } @@ -194,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("\\/"));