diff options
Diffstat (limited to 'src/chunk-render.cpp')
| -rw-r--r-- | src/chunk-render.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp index 529d4f64..0c5d5bc6 100644 --- a/src/chunk-render.cpp +++ b/src/chunk-render.cpp @@ -52,9 +52,15 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple if (_ground->atlases[i]) _ground->indexes[count++] = uint8_t(i); + if (count == 0) + { + ground_mesh = GL::Mesh{NoCreate}; + return { ground_mesh, {}, 0 }; + } + std::sort(_ground->indexes.begin(), _ground->indexes.begin() + count, [this](uint8_t a, uint8_t b) { - return _ground->atlases[a] < _ground->atlases[b]; + return _ground->atlases[a].get() < _ground->atlases[b].get(); }); float hack_offset = _coord.z <= 0 ? -16.f : 0.f; // XXX hack |
