- fixed P_LoopSideDefs could crash on the second P_LoopSidedefs call if there were unconnected linedefs in the map.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@943 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2010-09-08 08:53:54 +00:00
parent 67a7eefbb8
commit a2b6d9c276

View file

@ -2243,9 +2243,10 @@ static void P_LoopSidedefs (bool firstloop)
right = sidetemp[right].b.first;
if (firstloop && right == NO_SIDE)
{ // There is no right side!
Printf ("Line %d's right edge is unconnected\n", linemap[unsigned(line-lines)]);
if (right == NO_SIDE)
{
// There is no right side!
if (firstloop) Printf ("Line %d's right edge is unconnected\n", linemap[unsigned(line-lines)]);
continue;
}
@ -2290,6 +2291,8 @@ static void P_LoopSidedefs (bool firstloop)
right = bestright;
}
}
assert((unsigned)i<(unsigned)numsides);
assert(right<(unsigned)numsides);
sides[i].RightSide = right;
sides[right].LeftSide = i;
}