]> git.localhorst.tv Git - blank.git/blobdiff - src/io/WorldSave.cpp
treat head pitch and yaw as entity state
[blank.git] / src / io / WorldSave.cpp
index 6414dd0a7be43129f2840562454ead38ae12bc79..86532787653d1b24deef8baec749501eab3377ff 100644 (file)
@@ -130,6 +130,10 @@ void WorldSave::Read(Player &player) const {
                        in.ReadVec(state.block_pos);
                } else if (name == "orientation") {
                        in.ReadQuat(state.orient);
+               } else if (name == "pitch") {
+                       state.pitch = in.GetFloat();
+               } else if (name == "yaw") {
+                       state.yaw = in.GetFloat();
                } else if (name == "slot") {
                        int slot;
                        in.ReadNumber(slot);
@@ -151,6 +155,8 @@ void WorldSave::Write(const Player &player) const {
        out << "chunk = " << state.chunk_pos << ';' << endl;
        out << "position = " << state.block_pos << ';' << endl;
        out << "orientation = " << state.orient << ';' << endl;
+       out << "pitch = " << state.pitch << ';' << endl;
+       out << "yaw = " << state.yaw << ';' << endl;
        out << "slot = " << player.GetInventorySlot() << ';' << endl;
 }