summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-11 22:40:54 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-11 22:40:54 +0200
commit993d828c3c2cdab6174e460c39a605dbd31d192c (patch)
tree2fcecd8e76763d93cf7fa4929ec05886f0d36455 /src
parentcdb3091046ecc70a0c13437a49c2941c11cc67f5 (diff)
bbb
Diffstat (limited to 'src')
-rw-r--r--src/global-coords.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/global-coords.hpp b/src/global-coords.hpp
index 6d8e1525..a5f9dff0 100644
--- a/src/global-coords.hpp
+++ b/src/global-coords.hpp
@@ -54,6 +54,8 @@ struct chunk_coords_ final {
template<std::integral T> constexpr chunk_coords_& operator-=(Math::Vector2<T> off) noexcept {
x = int16_t(x - int{off.x()}); y = int16_t(y - int{off.y()}); z = int8_t(z - off.z()); return *this;
}
+
+ Vector3i operator-(chunk_coords_ other) const noexcept { return Vector3i{x - other.x, y - other.y, z - other.z}; }
};
constexpr inline int8_t chunk_z_min = -1, chunk_z_max = 14;