Commit d473e602 authored by Evan Ramos's avatar Evan Ramos
Browse files

SW: Fail gracefully from WarpToArea instead of aborting

parent cf3f6a1c
......@@ -180,6 +180,9 @@ WarpToArea(SPRITEp sp_from, int32_t* x, int32_t* y, int32_t* z, int16_t* sectnum
// exp: WARP_CEILING or WARP_CEILING_PLANE
if (sp->hitag == to_tag)
{
if ((unsigned)sp->sectnum >= MAXSECTORS)
return nullptr;
// determine new x,y,z position
*x = sp->x + xoff;
*y = sp->y + yoff;
......@@ -192,7 +195,6 @@ WarpToArea(SPRITEp sp_from, int32_t* x, int32_t* y, int32_t* z, int16_t* sectnum
*sectnum = sp->sectnum;
updatesector(*x, *y, sectnum);
ASSERT(*sectnum >= 0);
return sp;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment