Fix crash for maps with vertices above 32768

This commit is contained in:
Magnus Norddahl 2023-04-12 18:00:47 +02:00
parent 08be3607ce
commit 74b81bc65a
2 changed files with 2 additions and 7 deletions

View file

@ -487,7 +487,7 @@ struct FLevel
IntSector *GetBackSector(const IntSideDef *side); IntSector *GetBackSector(const IntSideDef *side);
IntSector *GetSectorFromSubSector(const MapSubsectorEx *sub); IntSector *GetSectorFromSubSector(const MapSubsectorEx *sub);
MapSubsectorEx *PointInSubSector(const int x, const int y); MapSubsectorEx *PointInSubSector(const int x, const int y);
FloatVertex GetSegVertex(int index); FloatVertex GetSegVertex(unsigned int index);
int FindFirstSectorFromTag(int tag); int FindFirstSectorFromTag(int tag);
unsigned FindFirstLineId(int lineId); unsigned FindFirstLineId(int lineId);

View file

@ -205,13 +205,8 @@ MapSubsectorEx *FLevel::PointInSubSector(const int x, const int y)
return &GLSubsectors[nodenum & ~NFX_SUBSECTOR]; return &GLSubsectors[nodenum & ~NFX_SUBSECTOR];
} }
FloatVertex FLevel::GetSegVertex(int index) FloatVertex FLevel::GetSegVertex(unsigned int index)
{ {
if (index & 0x8000)
{
index = (index & 0x7FFF) + NumGLVertices;
}
FloatVertex v; FloatVertex v;
v.x = F(GLVertices[index].x); v.x = F(GLVertices[index].x);
v.y = F(GLVertices[index].y); v.y = F(GLVertices[index].y);