- debug overlay line limit

This commit is contained in:
Ilya Shurumov 2020-05-06 16:12:06 +06:00
parent 827c137189
commit 9ee283fa32

View File

@ -67,6 +67,9 @@ void DrawDebugOverlays()
void Debug_AddLine(VECTOR& pointA, VECTOR& pointB, CVECTOR& color)
{
if (gDebug_numLines + 1 > 512)
return;
LineDef_t& ld = gDebug_Lines[gDebug_numLines++];
ld.posA = pointA;
ld.posB = pointB;
@ -78,6 +81,9 @@ void Debug_AddLine(VECTOR& pointA, VECTOR& pointB, CVECTOR& color)
void Debug_AddLineOfs(VECTOR& pointA, VECTOR& pointB, VECTOR& ofs, CVECTOR& color)
{
if (gDebug_numLines + 1 > 512)
return;
LineDef_t& ld = gDebug_Lines[gDebug_numLines++];
ld.posA = pointA;
ld.posB = pointB;