From 8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Mon, 22 May 2017 21:27:55 +0100 Subject: Store cChunk::m_BlockEntities in a map (#3717) * Store block entities in a map from block index * Cleanup ForEachBlockEntity * Cleanup DoWithBlockEntityAt --- src/SetChunkData.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/SetChunkData.h') diff --git a/src/SetChunkData.h b/src/SetChunkData.h index 2f3c3d6a3..63aec445b 100644 --- a/src/SetChunkData.h +++ b/src/SetChunkData.h @@ -24,7 +24,7 @@ public: /** Constructs a new instance based on data existing elsewhere, will copy all the memory. Prefer to use the other constructor as much as possible. - Will move the entity and blockentity lists into the internal storage, and invalidate a_Entities and + Will move the entity list and blockentities into the internal storage, and invalidate a_Entities and a_BlockEntities. When passing an lvalue, a_Entities and a_BlockEntities must be explicitly converted to an rvalue beforehand with std::move(). @@ -44,7 +44,7 @@ public: const cChunkDef::HeightMap * a_HeightMap, const cChunkDef::BiomeMap * a_Biomes, cEntityList && a_Entities, - cBlockEntityList && a_BlockEntities, + cBlockEntities && a_BlockEntities, bool a_ShouldMarkDirty ); @@ -73,7 +73,7 @@ public: cEntityList & GetEntities(void) { return m_Entities; } /** Returns the internal storage for block entities, read-write. */ - cBlockEntityList & GetBlockEntities(void) { return m_BlockEntities; } + cBlockEntities & GetBlockEntities(void) { return m_BlockEntities; } /** Returns whether both light arrays stored in this object are valid. */ bool IsLightValid(void) const { return m_IsLightValid; } @@ -108,7 +108,7 @@ protected: cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_Biomes; cEntityList m_Entities; - cBlockEntityList m_BlockEntities; + cBlockEntities m_BlockEntities; bool m_IsLightValid; bool m_IsHeightMapValid; -- cgit v1.2.3