File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ namespace tsom
148148
149149 inline void Chunk::Reset ()
150150 {
151+ m_activeLayers.clear ();
151152 m_blocks.clear ();
152153 m_blocks.resize (m_size.x * m_size.y * m_size.z , EmptyBlockIndex);
153154
@@ -168,13 +169,14 @@ namespace tsom
168169 // Chunks don't have any block until they are reset
169170 if (!HasContent ())
170171 {
172+ m_activeLayers.clear ();
173+ for (auto & layerOpt : m_layers)
174+ layerOpt.reset ();
175+
171176 m_blocks.resize (m_size.x * m_size.y * m_size.z , EmptyBlockIndex);
172177 m_blockTypeCount.resize (EmptyBlockIndex + 1 );
173178 m_blockTypeCount[EmptyBlockIndex] = m_blocks.size ();
174179
175- for (auto & layerOpt : m_layers)
176- layerOpt.reset ();
177-
178180 // Create first layer (empty block)
179181 RegisterLayer (0 );
180182 m_layers[0 ]->blockCount = m_blocks.size ();
You can’t perform that action at this time.
0 commit comments