- added missing range checks to level compatibility handler

This commit is contained in:
alexey.lysiuk 2019-01-02 16:35:23 +02:00
parent de88ca48ab
commit cb6b5e92ab

View file

@ -380,10 +380,13 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, OffsetSectorPlane)
PARAM_INT(planeval);
PARAM_FLOAT(delta);
sector_t *sec = &self->Level->sectors[sector];
secplane_t& plane = sector_t::floor == planeval? sec->floorplane : sec->ceilingplane;
plane.ChangeHeight(delta);
sec->ChangePlaneTexZ(planeval, delta);
if ((unsigned)sector < self->Level->sectors.Size())
{
sector_t *sec = &self->Level->sectors[sector];
secplane_t& plane = sector_t::floor == planeval? sec->floorplane : sec->ceilingplane;
plane.ChangeHeight(delta);
sec->ChangePlaneTexZ(planeval, delta);
}
return 0;
}
@ -400,7 +403,11 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, AddSectorTag)
PARAM_SELF_PROLOGUE(DLevelCompatibility);
PARAM_INT(sector);
PARAM_INT(tag);
tagManager.AddSectorTag(sector, tag);
if ((unsigned)sector < self->Level->sectors.Size())
{
tagManager.AddSectorTag(sector, tag);
}
return 0;
}