Skip to content

Commit 79f8894

Browse files
numberZeroMaksim
authored andcommitted
Check block mesh existence each frame
Apparently it may be dropped in the meanwhile
1 parent 745f579 commit 79f8894

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/client/clientmap.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,12 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
321321
camera_direction, camera_fov, 100000 * BS, &d))
322322
continue;
323323

324+
MapBlockMesh *mapBlockMesh = block->mesh;
325+
if (!mapBlockMesh)
326+
continue;
327+
324328
// Mesh animation
325329
if (pass == scene::ESNRP_SOLID) {
326-
//MutexAutoLock lock(block->mesh_mutex);
327-
MapBlockMesh *mapBlockMesh = block->mesh;
328-
assert(mapBlockMesh);
329330
// Pretty random but this should work somewhat nicely
330331
bool faraway = d >= BS * 50;
331332
if (mapBlockMesh->isAnimationForced() || !faraway ||
@@ -344,11 +345,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
344345
Get the meshbuffers of the block
345346
*/
346347
{
347-
//MutexAutoLock lock(block->mesh_mutex);
348-
349-
MapBlockMesh *mapBlockMesh = block->mesh;
350-
assert(mapBlockMesh);
351-
352348
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
353349
scene::IMesh *mesh = mapBlockMesh->getMesh(layer);
354350
assert(mesh);

0 commit comments

Comments
 (0)