diff options
author | andrew <xdotftw@gmail.com> | 2014-02-17 15:27:12 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-02-17 15:27:12 +0100 |
commit | 3b24bc870bb39a8b8812ed307250e1188b9ff788 (patch) | |
tree | 8b6cf830e06a0fe6bd1eb8769ba571f9316a4707 /src/World.cpp | |
parent | cMap::UpdateRadius (diff) | |
download | cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.gz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.bz2 cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.lz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.xz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.zst cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.zip |
Diffstat (limited to '')
-rw-r--r-- | src/World.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/World.cpp b/src/World.cpp index 2a3e53332..55c6fbb7a 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1574,8 +1574,7 @@ cMap * cWorld::CreateMap(int a_CenterX, int a_CenterY, int a_Scale) { if (m_MapData.size() >= 65536) { - LOGD("cWorld::CreateMap - Too many maps in use"); - + LOGWARN("Could not craft map - Too many maps in use"); return NULL; } @@ -2992,9 +2991,12 @@ void cWorld::LoadMapData(void) { cIDCountSerializer IDSerializer(GetName()); - IDSerializer.Load(); + if (!IDSerializer.Load()) + { + return; + } - unsigned int MapCount = IDSerializer.GetMapCount() + 1; + unsigned int MapCount = IDSerializer.GetMapCount(); m_MapData.clear(); @@ -3004,7 +3006,10 @@ void cWorld::LoadMapData(void) cMapSerializer Serializer(GetName(), &Map); - Serializer.Load(); + if (!Serializer.Load()) + { + LOGWARN("Could not load map #%i", Map.GetID()); + } m_MapData.push_back(Map); } @@ -3023,9 +3028,13 @@ void cWorld::SaveMapData(void) cIDCountSerializer IDSerializer(GetName()); - IDSerializer.SetMapCount(m_MapData.size() - 1); + IDSerializer.SetMapCount(m_MapData.size()); - IDSerializer.Save(); + if (!IDSerializer.Save()) + { + LOGERROR("Could not save idcounts.dat"); + return; + } for (cMapList::iterator it = m_MapData.begin(); it != m_MapData.end(); ++it) { @@ -3033,7 +3042,10 @@ void cWorld::SaveMapData(void) cMapSerializer Serializer(GetName(), &Map); - Serializer.Save(); + if (!Serializer.Save()) + { + LOGWARN("Could not save map #%i", Map.GetID()); + } } } |