summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-06 15:38:56 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-06 15:38:56 +0200
commit17b2aed123899a8b4b8547fa18671fa3eb3e48fe (patch)
tree2c4ba1cb30feff94d3c4a25594efad3a4b55cef6 /src
parentd402f109df796e691306879903ddf09b2328d9e6 (diff)
a
Diffstat (limited to 'src')
-rw-r--r--src/object.cpp4
-rw-r--r--src/world.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/object.cpp b/src/object.cpp
index 3316dac8..3c2be9ef 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -168,7 +168,7 @@ bool object::can_move_to(Vector2i delta, global_coords coord2, Vector2b offset,
return false;
auto& w = *c->_world;
- auto& c_ = coord_.chunk() == coord.chunk() ? *c : w[{coord_.chunk(), coord_.z()}];
+ auto& c_ = coord_.chunk() == coord.chunk() ? *c : w[chunk_coords_{coord_}];
const auto center = Vector2(coord_.local())*TILE_SIZE2 + Vector2(offset_) + Vector2(bbox_offset),
half_bbox = Vector2(bbox_size)*.5f,
@@ -223,7 +223,7 @@ void object::move_to(size_t& i, Vector2i delta, rotation new_r)
else
{
//fm_debug("change-chunk (%hd;%hd|%hhd;%hhd)", coord_.chunk().x, coord_.chunk().y, coord_.local().x, coord_.local().y);
- auto& c2 = w[{coord_.chunk(), coord_.z()}];
+ auto& c2 = w[chunk_coords_{coord_}];
if (!is_dynamic())
c2.mark_scenery_modified();
c2._add_bbox(bb1);
diff --git a/src/world.cpp b/src/world.cpp
index 29c9378e..221b98f8 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -92,7 +92,7 @@ chunk& world::operator[](chunk_coords_ coord) noexcept
auto world::operator[](global_coords pt) noexcept -> pair
{
- auto& c = operator[]({pt.chunk(), pt.z()});
+ auto& c = operator[](chunk_coords_{pt});
return { c, c[pt.local()] };
}