From c0b62ef139a65ca648135fb6999e6623438fdd71 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 24 Jul 2014 18:32:05 +0200 Subject: Added a queue for setting chunk data. Fixes #1196. --- src/WorldStorage/WSSAnvil.cpp | 5 +++-- src/WorldStorage/WSSCompact.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/WorldStorage') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 663d489bc..2851647fe 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -14,6 +14,7 @@ #include "../Item.h" #include "../ItemGrid.h" #include "../StringCompression.h" +#include "../SetChunkData.h" #include "../BlockEntities/ChestEntity.h" #include "../BlockEntities/CommandBlockEntity.h" @@ -391,7 +392,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT } // for y //*/ - m_World->SetChunkData( + m_World->QueueSetChunkData(cSetChunkDataPtr(new cSetChunkData( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, BlockTypes, MetaData, IsLightValid ? BlockLight : NULL, @@ -399,7 +400,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT NULL, Biomes, Entities, BlockEntities, false - ); + ))); return true; } diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp index 5382a3e01..ee47047a0 100644 --- a/src/WorldStorage/WSSCompact.cpp +++ b/src/WorldStorage/WSSCompact.cpp @@ -18,6 +18,7 @@ #include "../BlockEntities/MobHeadEntity.h" #include "../BlockEntities/NoteEntity.h" #include "../BlockEntities/SignEntity.h" +#include "../SetChunkData.h" @@ -911,7 +912,7 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_Uncompre NIBBLETYPE * BlockLight = (NIBBLETYPE *)(BlockData + LightOffset); NIBBLETYPE * SkyLight = (NIBBLETYPE *)(BlockData + SkyLightOffset); - a_World->SetChunkData( + a_World->QueueSetChunkData(cSetChunkDataPtr(new cSetChunkData( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, BlockData, MetaData, IsLightValid ? BlockLight : NULL, @@ -919,7 +920,7 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_Uncompre NULL, NULL, Entities, BlockEntities, false - ); + ))); return true; } -- cgit v1.2.3 From 4191be7ddba820af4ed0c505a8d62416c2b7a8b4 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 22 Jul 2014 15:36:13 -0700 Subject: Removed redundant semicolons and re-added warning --- src/WorldStorage/FastNBT.h | 2 +- src/WorldStorage/WorldStorage.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/WorldStorage') diff --git a/src/WorldStorage/FastNBT.h b/src/WorldStorage/FastNBT.h index 7aa83fc24..4ef72e379 100644 --- a/src/WorldStorage/FastNBT.h +++ b/src/WorldStorage/FastNBT.h @@ -160,7 +160,7 @@ public: /** Returns the direct child tag of the specified name, or -1 if no such tag. */ int FindChildByName(int a_Tag, const char * a_Name, size_t a_NameLength = 0) const; - /** Returns the child tag of the specified path (Name1\Name2\Name3...), or -1 if no such tag. */ + /** Returns the child tag of the specified path (Name1/Name2/Name3...), or -1 if no such tag. */ int FindTagByPath(int a_Tag, const AString & a_Path) const; eTagType GetType(int a_Tag) const { return m_Tags[(size_t)a_Tag].m_Type; } diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h index 2d5d9c830..978a5b5d1 100644 --- a/src/WorldStorage/WorldStorage.h +++ b/src/WorldStorage/WorldStorage.h @@ -103,11 +103,11 @@ protected: struct FuncTable { - static void Delete(sChunkLoad) {}; + static void Delete(sChunkLoad) {} static void Combine(sChunkLoad & a_orig, const sChunkLoad a_new) { a_orig.m_Generate |= a_new.m_Generate; - }; + } }; typedef cQueue sChunkLoadQueue; -- cgit v1.2.3