mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
SW: Fail gracefully from WarpToArea instead of aborting
This commit is contained in:
parent
f318d2282a
commit
71dc4ff5a4
1 changed files with 3 additions and 1 deletions
|
@ -183,6 +183,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;
|
||||
|
@ -195,7 +198,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue