Make sure we detect if start >= numlines so we can deal with that properly

for some apparent reason the compiler didn't like the while loop condition edit on its own (it complained about inline failures for P_MobjReadyToTrigger for some reason), so I had to add that extra bit above the while loop... and it was happy again, huh
This commit is contained in:
Monster Iestyn 2016-07-28 14:57:19 +01:00
parent 4321757df4
commit 2b985bda85
1 changed files with 4 additions and 1 deletions

View File

@ -1188,7 +1188,10 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
{
start++;
while (lines[start].special != special)
if (start >= (INT32)numlines)
return -1;
while (start < (INT32)numlines && lines[start].special != special)
start++;
if (start >= (INT32)numlines)