- replaced P_FindSectorFromTag with an FSectorTagIterator class.

This is done to encapsulate the gory details of tag search in one place so that the implementation of multiple tags per sector remains contained to a few isolated spots in the code.
This also moves the special 'tag == 0 -> activate backsector' handling into the iterator class.
This commit is contained in:
Christoph Oelckers 2015-04-14 22:39:57 +02:00
commit 425e5b9ffc
18 changed files with 354 additions and 329 deletions

View file

@ -510,9 +510,9 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
P_ActivateInStasisCeiling (tag);
}
secnum = -1;
// affects all sectors with the same tag as the linedef
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
FSectorTagIterator it(tag);
while ((secnum = it.Next()) >= 0)
{
rtn |= !!DCeiling::Create(&sectors[secnum], type, line, tag, speed, speed2, height, crush, silent, change, hexencrush);
}