diff options
author | Mattes D <github@xoft.cz> | 2014-12-11 14:34:09 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-11 14:34:09 +0100 |
commit | 33c6ff872e72563b6e888476b66c4e9c19f8c840 (patch) | |
tree | fd77a6a003bdaa837e1ab265f35c82275d13e489 /src/WorldStorage/WSSAnvil.cpp | |
parent | Merge remote-tracking branch 'planetx/master' (diff) | |
download | cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar.gz cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar.bz2 cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar.lz cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar.xz cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.tar.zst cuberite-33c6ff872e72563b6e888476b66c4e9c19f8c840.zip |
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index ad875b4cb..af65db700 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2966,10 +2966,11 @@ bool cWSSAnvil::cMCAFile::OpenFile(bool a_IsForReading) if (writeOutNeeded) { + m_File.Seek(0); if ( - (m_File.Write(m_Header, sizeof(m_Header)) != sizeof(m_Header)) || // Write chunk offsets - (m_File.Write(m_TimeStamps, sizeof(m_TimeStamps)) != sizeof(m_TimeStamps)) // Write chunk timestamps - ) + (m_File.Write(m_Header, sizeof(m_Header)) != sizeof(m_Header)) || // Write chunk offsets + (m_File.Write(m_TimeStamps, sizeof(m_TimeStamps)) != sizeof(m_TimeStamps)) // Write chunk timestamps + ) { LOGWARNING("Cannot process MCA header in file \"%s\", chunks in that file will be lost", m_FileName.c_str()); m_File.Close(); @@ -3104,7 +3105,7 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri m_Header[LocalX + 32 * LocalZ] = htonl((ChunkSector << 8) | ChunkSize); // Set the modification time - m_TimeStamps[LocalX + 32 * LocalZ] = htonl(time(nullptr)); + m_TimeStamps[LocalX + 32 * LocalZ] = htonl(static_cast<u_long>(time(nullptr))); if (m_File.Seek(0) < 0) { |