1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix incorrect comparison operator

This commit is contained in:
Tomasz Zieliński
2024-05-08 15:09:11 +02:00
parent eece03d24f
commit 37d062f1eb

View File

@@ -38,14 +38,10 @@ Point2D Point2D::operator - (const Point2D& other) const
bool Point2D::operator < (const Point2D& other) const
{
if (x() < other.x())
{
return true;
}
else
{
return y() < other.y();
}
if (x() != other.x())
return x() < other.x();
return y() < other.y();
}
std::string Point2D::toString() const
@@ -177,7 +173,7 @@ std::set<Point2D> PenroseTiling::generatePenroseTiling(size_t numZones, CRandomG
std::set<Point2D> uniquePoints(points.begin(), points.end());
std::vector<Point2D> uniquePointsVec(uniquePoints.begin(), uniquePoints.end());
logGlobal->info("Generated %d vertices and %d unique vertices", points.size(), uniquePointsVec.size());
// Find center of the mass, shift that center to (0.5, 0.5)
Point2D center = Point2D(0.0f, 0.0f);
for (const auto & point : uniquePointsVec)