summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-18 01:45:19 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-19 14:32:18 +0100
commit151e6911a8aa56749edbbf0c15ab04752d96c2f3 (patch)
tree06fcf3d6551d1945b5717458aa09222c947ede04 /src
parente77dc91b5d3e6a5181776a81cee2c3164c7b3cc9 (diff)
ccc
Diffstat (limited to 'src')
-rw-r--r--src/object.cpp14
-rw-r--r--src/world.cpp6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/object.cpp b/src/object.cpp
index 72d922fc..7f0b9afb 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -197,15 +197,15 @@ 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_.chunk3()];
+ auto& cʹ = coord_.chunk() == coord.chunk() ? *c : w[coord_.chunk3()];
const auto center = Vector2(coord_.local())*TILE_SIZE2 + Vector2(offset_) + Vector2(bbox_offset),
half_bbox = Vector2(bbox_size)*.5f,
min = center - half_bbox, max = min + Vector2(bbox_size);
- if (!do_search<false>(&c_, coord_, id, min, max))
+ if (!do_search<false>(&cʹ, coord_, id, min, max))
return false;
for (const auto& off : world::neighbor_offsets)
- if (!do_search(&c_, coord_, id, min, max, off))
+ if (!do_search(&cʹ, coord_, id, min, max, off))
return false;
return true;
}
@@ -232,8 +232,8 @@ void object::teleport_to(size_t& i, global_coords coord_, Vector2b offset_, rota
}
fm_assert(i < c->_objects.size());
- const auto e_ = c->_objects[i];
- fm_assert(&*e_ == this);
+ const auto eʹ = c->_objects[i];
+ fm_assert(&*eʹ == this);
if (coord_ == coord && offset_ == offset)
return;
@@ -268,8 +268,8 @@ void object::teleport_to(size_t& i, global_coords coord_, Vector2b offset_, rota
set_bbox_(offset_, bb_offset, bb_size, pass);
const_cast<rotation&>(r) = new_r;
const_cast<class chunk*&>(c) = &c2;
- i = (size_t)std::distance(es.cbegin(), std::lower_bound(es.cbegin(), es.cend(), e_, object_id_lessp));
- arrayInsert(es, i, move(e_));
+ i = (size_t)std::distance(es.cbegin(), std::lower_bound(es.cbegin(), es.cend(), eʹ, object_id_lessp));
+ arrayInsert(es, i, move(eʹ));
}
}
diff --git a/src/world.cpp b/src/world.cpp
index adbcf540..7a4fc079 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -231,16 +231,16 @@ shared_ptr_wrapper<critter> world::ensure_player_character(object_id& id_, critt
for (const auto& [coord, c] : chunks()) // todo use world::_objects
{
- for (const auto& e_ : c.objects())
+ for (const auto& eʹ : c.objects())
{
- const auto& e = *e_;
+ const auto& e = *eʹ;
if (e.type() == object_type::critter)
{
const auto& C = static_cast<const critter&>(e);
if (C.playable)
{
id = std::min(id, C.id);
- ret.ptr = std::static_pointer_cast<critter>(e_);
+ ret.ptr = std::static_pointer_cast<critter>(eʹ);
}
}
}