summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-30 13:45:28 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-30 16:30:25 +0100
commit90b214c0a4b3c91ad021c9923f1b8a69ccbe88e8 (patch)
treeba018d88faee760820c7525862101c1bb66284bb
parentccf843360374c2f91d4d9420e4d2ccd73a03e703 (diff)
src: add missing scenery check in tile_ref::operator==
-rw-r--r--src/scenery.cpp9
-rw-r--r--src/scenery.hpp2
-rw-r--r--src/tile.cpp9
3 files changed, 16 insertions, 4 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp
index 5f82e151..23967af8 100644
--- a/src/scenery.cpp
+++ b/src/scenery.cpp
@@ -108,4 +108,13 @@ bool scenery::activate(const anim_atlas& atlas)
return false;
}
+#ifdef __GNUG__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+bool scenery::operator==(const scenery&) const noexcept = default;
+#ifdef __GNUG__
+#pragma GCC diagnostic pop
+#endif
+
} // namespace floormat
diff --git a/src/scenery.hpp b/src/scenery.hpp
index 5f755bfd..05a72b43 100644
--- a/src/scenery.hpp
+++ b/src/scenery.hpp
@@ -45,6 +45,8 @@ struct scenery final
bool passable = false, bool blocks_view = false, bool active = false, bool interactive = false);
scenery(door_tag_t, const anim_atlas& atlas, rotation r, bool is_open = false);
+ bool operator==(const scenery&) const noexcept;
+
bool can_activate() const noexcept;
bool activate(const anim_atlas& atlas);
void update(float dt, const anim_atlas& anim);
diff --git a/src/tile.cpp b/src/tile.cpp
index 5f003258..56ac5746 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -80,10 +80,11 @@ bool operator==(const tile_ref& a, const tile_ref& b) noexcept
if (a._chunk == b._chunk && a.i == b.i)
return true;
else
- return a.ground() == b.ground() &&
- a.wall_north() == b.wall_north() &&
- a.wall_west() == b.wall_west() &&
- a.pass_mode() == b.pass_mode();
+ return a.ground() == b.ground() &&
+ a.wall_north() == b.wall_north() &&
+ a.wall_west() == b.wall_west() &&
+ a.scenery() == b.scenery() &&
+ a.pass_mode() == b.pass_mode();
}
} // namespace floormat