Fix crash when passing updatesectorz() an invalid sector number > numsectors and < MAXSECTORS

git-svn-id: https://svn.eduke32.com/eduke32@7549 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-04-09 19:21:33 +00:00 committed by Christoph Oelckers
parent e8a401759d
commit 030f0b7013

View file

@ -11057,7 +11057,7 @@ void updatesectorz(int32_t const x, int32_t const y, int32_t const z, int16_t *
if ((unsigned)*sectnum >= (unsigned)numsectors)
{
if ((unsigned)*sectnum < (unsigned)numsectors + MAXSECTORS)
if (*sectnum >= MAXSECTORS && (unsigned)*sectnum < (unsigned)numsectors + MAXSECTORS)
{
*sectnum -= MAXSECTORS;
nofirstzcheck = true;