summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-08 09:34:20 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-08 09:34:20 +0200
commit59becaeefcb564356d87aaf19cf67fccea311ca3 (patch)
treeea3662bfa10eab8649f4ac0975ed71bde25f4ea4
parent721ce1bbb6f04f380343766d87ffdd9d4407b577 (diff)
src/world: add z level range check
-rw-r--r--src/world.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 56a0b735..4e8e0095 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -81,6 +81,7 @@ world::world(size_t capacity) : _chunks{capacity}
chunk& world::operator[](chunk_coords_ coord) noexcept
{
+ fm_debug_assert(coord.z >= -8 && coord.z < 8);
auto& [c, coord2] = _last_chunk;
if (coord != coord2)
c = &_chunks.try_emplace(coord, *this).first->second;