X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fio%2FWorldSave.cpp;h=8422623f36746262f30e10f0d78942a44f635439;hb=33a9e73a4f9ed21c59a321fedeb4277318531abe;hp=86532787653d1b24deef8baec749501eab3377ff;hpb=33b37e7242e4cbfa76e4a0d6e5bb54223b541162;p=blank.git diff --git a/src/io/WorldSave.cpp b/src/io/WorldSave.cpp index 8653278..8422623 100644 --- a/src/io/WorldSave.cpp +++ b/src/io/WorldSave.cpp @@ -125,9 +125,9 @@ void WorldSave::Read(Player &player) const { in.ReadIdentifier(name); in.Skip(Token::EQUALS); if (name == "chunk") { - in.ReadVec(state.chunk_pos); + in.ReadVec(state.pos.chunk); } else if (name == "position") { - in.ReadVec(state.block_pos); + in.ReadVec(state.pos.block); } else if (name == "orientation") { in.ReadQuat(state.orient); } else if (name == "pitch") { @@ -152,8 +152,8 @@ void WorldSave::Write(const Player &player) const { } const EntityState &state = player.GetEntity().GetState(); ofstream out(PlayerPath(player)); - out << "chunk = " << state.chunk_pos << ';' << endl; - out << "position = " << state.block_pos << ';' << endl; + out << "chunk = " << state.pos.chunk << ';' << endl; + out << "position = " << state.pos.block << ';' << endl; out << "orientation = " << state.orient << ';' << endl; out << "pitch = " << state.pitch << ';' << endl; out << "yaw = " << state.yaw << ';' << endl; @@ -167,7 +167,7 @@ string WorldSave::PlayerPath(const Player &player) const { } -bool WorldSave::Exists(const Chunk::Pos &pos) const noexcept { +bool WorldSave::Exists(const ExactLocation::Coarse &pos) const noexcept { return is_file(ChunkPath(pos)); } @@ -217,7 +217,7 @@ void WorldSave::Write(Chunk &chunk) const { } -const char *WorldSave::ChunkPath(const Chunk::Pos &pos) const { +const char *WorldSave::ChunkPath(const ExactLocation::Coarse &pos) const { snprintf(chunk_buf.get(), chunk_bufsiz, chunk_path.c_str(), pos.x, pos.y, pos.z); return chunk_buf.get(); }