mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- iterators in CollectPortals
This commit is contained in:
parent
8df851c3e3
commit
79dcd2c178
1 changed files with 12 additions and 14 deletions
|
@ -1049,13 +1049,12 @@ void CollectPortals()
|
|||
// pick one sprite out of the sectors, repeat until we get a valid connection
|
||||
for (auto sec : fp.sectors)
|
||||
{
|
||||
SectIterator it(sec);
|
||||
int spr;
|
||||
while ((spr = it.NextIndex()) >= 0)
|
||||
SWSectIterator it(sec);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
int tx = sprite[spr].x;
|
||||
int ty = sprite[spr].y;
|
||||
int tz = sprite[spr].z;
|
||||
int tx = actor->s().x;
|
||||
int ty = actor->s().y;
|
||||
int tz = actor->s().z;
|
||||
int16_t tsectnum = sec;
|
||||
|
||||
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL1);
|
||||
|
@ -1067,7 +1066,7 @@ void CollectPortals()
|
|||
// got something!
|
||||
fp.othersector = tsectnum;
|
||||
fp.offset = { tx, ty, tz };
|
||||
fp.offset -= sprite[spr].pos;
|
||||
fp.offset -= actor->s().pos;
|
||||
goto nextfg;
|
||||
}
|
||||
}
|
||||
|
@ -1080,13 +1079,12 @@ void CollectPortals()
|
|||
{
|
||||
for (auto sec : fp.sectors)
|
||||
{
|
||||
SectIterator it(sec);
|
||||
int spr;
|
||||
while ((spr = it.NextIndex()) >= 0)
|
||||
SWSectIterator it(sec);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
int tx = sprite[spr].x;
|
||||
int ty = sprite[spr].y;
|
||||
int tz = sprite[spr].z;
|
||||
int tx = actor->s().x;
|
||||
int ty = actor->s().y;
|
||||
int tz = actor->s().z;
|
||||
int16_t tsectnum = sec;
|
||||
|
||||
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL2);
|
||||
|
@ -1098,7 +1096,7 @@ void CollectPortals()
|
|||
// got something!
|
||||
fp.othersector = tsectnum;
|
||||
fp.offset = { tx, ty, tz };
|
||||
fp.offset -= sprite[spr].pos;
|
||||
fp.offset -= actor->s().pos;
|
||||
goto nextcg;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue