summaryrefslogtreecommitdiffhomepage
path: root/src/hole.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-05-28 04:47:29 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-05-28 04:47:29 +0200
commit6f4e493d7cbe514527e2b2d942040609ef930da9 (patch)
treef8582972e1c970c884cfdea8589882c184bf1ff6 /src/hole.cpp
parent13cf28c20f441876f9f608373788ed5104f817aa (diff)
fix hole_proto::operator==
Diffstat (limited to 'src/hole.cpp')
-rw-r--r--src/hole.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/hole.cpp b/src/hole.cpp
index fa4a80d6..6a48e57b 100644
--- a/src/hole.cpp
+++ b/src/hole.cpp
@@ -18,7 +18,18 @@ hole_proto::hole_proto(hole_proto&&) noexcept = default;
hole_proto& hole_proto::operator=(hole_proto&&) noexcept = default;
bool hole_proto::flags::operator==(const struct flags&) const = default;
-bool hole_proto::operator==(const hole_proto&) const = default;
+
+bool hole_proto::operator==(const object_proto& oʹ) const
+{
+ if (type != oʹ.type)
+ return false;
+
+ if (!object_proto::operator==(oʹ))
+ return false;
+
+ const auto& o = static_cast<const hole_proto&>(oʹ);
+ return height == o.height && z_offset == o.z_offset && flags == o.flags;
+}
hole_proto::hole_proto()
{