Fix crash for maps with vertices above 32768

This commit is contained in:
Magnus Norddahl 2023-04-12 18:00:47 +02:00 committed by nashmuhandes
parent d7b5fbf445
commit 83395455e6
2 changed files with 2 additions and 7 deletions

View file

@ -454,7 +454,7 @@ struct FLevel
IntSector *GetBackSector(const IntSideDef *side);
IntSector *GetSectorFromSubSector(const MapSubsectorEx *sub);
MapSubsectorEx *PointInSubSector(const int x, const int y);
FloatVertex GetSegVertex(int index);
FloatVertex GetSegVertex(unsigned int index);
vec3 GetLightProbePosition(int index);

View file

@ -226,13 +226,8 @@ MapSubsectorEx *FLevel::PointInSubSector(const int x, const int y)
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;
v.x = F(GLVertices[index].x);
v.y = F(GLVertices[index].y);