fix nopch

* and use Position const& for polygon origin
* aed08b8a82 followup
This commit is contained in:
ModoX
2025-02-06 21:19:00 +01:00
parent aed08b8a82
commit 926f36758a
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
#include "AreaBoundary.h" #include "AreaBoundary.h"
#include "Unit.h" #include "Unit.h"
#include <vector>
// ---== RECTANGLE ==--- // ---== RECTANGLE ==---
RectangleBoundary::RectangleBoundary(float southX, float northX, float eastY, float westY, bool isInverted) : RectangleBoundary::RectangleBoundary(float southX, float northX, float eastY, float westY, bool isInverted) :
@@ -91,7 +92,7 @@ bool ZRangeBoundary::IsWithinBoundaryArea(Position const* pos) const
} }
// ---== POLYGON ==--- // ---== POLYGON ==---
PolygonBoundary::PolygonBoundary(Position origin, std::vector<Position>&& vertices, bool isInverted /* = false*/) : PolygonBoundary::PolygonBoundary(Position const& origin, std::vector<Position>&& vertices, bool isInverted /* = false*/) :
AreaBoundary(isInverted), _origin(origin), _vertices(std::move(vertices)) { } AreaBoundary(isInverted), _origin(origin), _vertices(std::move(vertices)) { }
bool PolygonBoundary::IsWithinBoundaryArea(Position const* pos) const bool PolygonBoundary::IsWithinBoundaryArea(Position const* pos) const
+1 -1
View File
@@ -153,7 +153,7 @@ class TC_GAME_API ZRangeBoundary : public AreaBoundary
class TC_GAME_API PolygonBoundary : public AreaBoundary class TC_GAME_API PolygonBoundary : public AreaBoundary
{ {
public: public:
PolygonBoundary(Position origin, std::vector<Position>&& vertices, bool isInverted = false); PolygonBoundary(Position const& origin, std::vector<Position>&& vertices, bool isInverted = false);
protected: protected:
bool IsWithinBoundaryArea(Position const* pos) const override; bool IsWithinBoundaryArea(Position const* pos) const override;