diff --git a/source/core/intvec.h b/source/core/intvec.h index 5550b2a4d..7c89c389f 100644 --- a/source/core/intvec.h +++ b/source/core/intvec.h @@ -18,6 +18,7 @@ struct vec2_t vec2_t operator-(const vec2_t& other) const { return { x - other.x, y - other.y }; } vec2_t& operator+=(const vec2_t& other) { x += other.x; y += other.y; return *this; }; vec2_t& operator-=(const vec2_t& other) { x -= other.x; y -= other.y; return *this; }; + bool operator == (const vec2_t& other) const { return x == other.x && y == other.y; }; }; struct vec3_t diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index e6be922d4..695c464a8 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -304,6 +304,8 @@ void SectorGeometry::ValidateSector(unsigned int secnum, int plane) sec->floorxpan_ == compare->floorxpan_ && sec->floorypan_ == compare->floorypan_ && sec->floorz == compare->floorz && + wall[sec->wallptr].pos == data[secnum].poscompare && + wall[wall[sec->wallptr].point2].pos == data[secnum].poscompare && !(sec->dirty & 1) && data[secnum].planes[plane].vertices.Size() ) return; sec->dirty &= ~1; @@ -316,10 +318,13 @@ void SectorGeometry::ValidateSector(unsigned int secnum, int plane) sec->ceilingxpan_ == compare->ceilingxpan_ && sec->ceilingypan_ == compare->ceilingypan_ && sec->ceilingz == compare->ceilingz && + wall[wall[sec->wallptr].point2].pos == data[secnum].poscompare && !(sec->dirty & 2) && data[secnum].planes[plane].vertices.Size()) return; sec->dirty &= ~2; } *compare = *sec; + data[secnum].poscompare == wall[sec->wallptr].pos; + data[secnum].poscompare2 == wall[wall[sec->wallptr].point2].pos; MakeVertices(secnum, plane); } diff --git a/source/core/sectorgeometry.h b/source/core/sectorgeometry.h index 487fd6e32..caa5de6e0 100644 --- a/source/core/sectorgeometry.h +++ b/source/core/sectorgeometry.h @@ -15,6 +15,8 @@ struct SectorGeometryData { SectorGeometryPlane planes[2]; sectortype compare{}; + vec2_t poscompare{ }; + vec2_t poscompare2{ }; }; class SectorGeometry