diff --git a/ScuffedMinecraft/src/Planet.cpp b/ScuffedMinecraft/src/Planet.cpp index 1e40bd4..3ee01e5 100644 --- a/ScuffedMinecraft/src/Planet.cpp +++ b/ScuffedMinecraft/src/Planet.cpp @@ -103,9 +103,11 @@ void Planet::ChunkThreadUpdate() chunks.find({ pos.x, pos.y, pos.z - 1 }) == chunks.end()) { delete chunkData.at(pos); - chunkData.erase(pos); + it = chunkData.erase(it); + } + else { + ++it; } - ++it; } // Check if camera moved to new chunk