Compare commits

..

1 Commits

Author SHA1 Message Date
nowinar
125f993067 Fixing crash in which when you lowered the render distance game would crash. 2024-11-02 22:20:02 +01:00

View File

@ -103,10 +103,12 @@ void Planet::ChunkThreadUpdate()
chunks.find({ pos.x, pos.y, pos.z - 1 }) == chunks.end()) chunks.find({ pos.x, pos.y, pos.z - 1 }) == chunks.end())
{ {
delete chunkData.at(pos); delete chunkData.at(pos);
chunkData.erase(pos); it = chunkData.erase(it);
} }
else {
++it; ++it;
} }
}
// Check if camera moved to new chunk // Check if camera moved to new chunk
if (camChunkX != lastCamX || camChunkY != lastCamY || camChunkZ != lastCamZ) if (camChunkX != lastCamX || camChunkY != lastCamY || camChunkZ != lastCamZ)