mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
- added missing range checks to level compatibility handler
This commit is contained in:
parent
de88ca48ab
commit
cb6b5e92ab
1 changed files with 12 additions and 5 deletions
|
@ -380,10 +380,13 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, OffsetSectorPlane)
|
||||||
PARAM_INT(planeval);
|
PARAM_INT(planeval);
|
||||||
PARAM_FLOAT(delta);
|
PARAM_FLOAT(delta);
|
||||||
|
|
||||||
|
if ((unsigned)sector < self->Level->sectors.Size())
|
||||||
|
{
|
||||||
sector_t *sec = &self->Level->sectors[sector];
|
sector_t *sec = &self->Level->sectors[sector];
|
||||||
secplane_t& plane = sector_t::floor == planeval? sec->floorplane : sec->ceilingplane;
|
secplane_t& plane = sector_t::floor == planeval? sec->floorplane : sec->ceilingplane;
|
||||||
plane.ChangeHeight(delta);
|
plane.ChangeHeight(delta);
|
||||||
sec->ChangePlaneTexZ(planeval, delta);
|
sec->ChangePlaneTexZ(planeval, delta);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +403,11 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, AddSectorTag)
|
||||||
PARAM_SELF_PROLOGUE(DLevelCompatibility);
|
PARAM_SELF_PROLOGUE(DLevelCompatibility);
|
||||||
PARAM_INT(sector);
|
PARAM_INT(sector);
|
||||||
PARAM_INT(tag);
|
PARAM_INT(tag);
|
||||||
|
|
||||||
|
if ((unsigned)sector < self->Level->sectors.Size())
|
||||||
|
{
|
||||||
tagManager.AddSectorTag(sector, tag);
|
tagManager.AddSectorTag(sector, tag);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue