]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Fix NULL pointer bug in meshgen
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 13 Feb 2022 17:09:26 +0000 (18:09 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 13 Feb 2022 17:09:26 +0000 (18:09 +0100)
src/client/blockmesh.c

index 8af015131a0aecc37ad8993c297a8de96859ce37..25274e21a671ed9539c6e0563c93d407bf641dd1 100644 (file)
@@ -117,10 +117,12 @@ void blockmesh_make(MapBlock *block)
 
        pthread_mutex_lock(&block->mtx);
        if (extra->obj) {
-               extra->obj->remove = true;
+               if (obj) {
+                       obj->scale = extra->obj->scale;
+                       object_transform(obj);
+               }
 
-               obj->scale = extra->obj->scale;
-               object_transform(obj);
+               extra->obj->remove = true;
        }
 
        extra->obj = obj;