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
|
// pick one sprite out of the sectors, repeat until we get a valid connection
|
||||||
for (auto sec : fp.sectors)
|
for (auto sec : fp.sectors)
|
||||||
{
|
{
|
||||||
SectIterator it(sec);
|
SWSectIterator it(sec);
|
||||||
int spr;
|
while (auto actor = it.Next())
|
||||||
while ((spr = it.NextIndex()) >= 0)
|
|
||||||
{
|
{
|
||||||
int tx = sprite[spr].x;
|
int tx = actor->s().x;
|
||||||
int ty = sprite[spr].y;
|
int ty = actor->s().y;
|
||||||
int tz = sprite[spr].z;
|
int tz = actor->s().z;
|
||||||
int16_t tsectnum = sec;
|
int16_t tsectnum = sec;
|
||||||
|
|
||||||
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL1);
|
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL1);
|
||||||
|
@ -1067,7 +1066,7 @@ void CollectPortals()
|
||||||
// got something!
|
// got something!
|
||||||
fp.othersector = tsectnum;
|
fp.othersector = tsectnum;
|
||||||
fp.offset = { tx, ty, tz };
|
fp.offset = { tx, ty, tz };
|
||||||
fp.offset -= sprite[spr].pos;
|
fp.offset -= actor->s().pos;
|
||||||
goto nextfg;
|
goto nextfg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1080,13 +1079,12 @@ void CollectPortals()
|
||||||
{
|
{
|
||||||
for (auto sec : fp.sectors)
|
for (auto sec : fp.sectors)
|
||||||
{
|
{
|
||||||
SectIterator it(sec);
|
SWSectIterator it(sec);
|
||||||
int spr;
|
while (auto actor = it.Next())
|
||||||
while ((spr = it.NextIndex()) >= 0)
|
|
||||||
{
|
{
|
||||||
int tx = sprite[spr].x;
|
int tx = actor->s().x;
|
||||||
int ty = sprite[spr].y;
|
int ty = actor->s().y;
|
||||||
int tz = sprite[spr].z;
|
int tz = actor->s().z;
|
||||||
int16_t tsectnum = sec;
|
int16_t tsectnum = sec;
|
||||||
|
|
||||||
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL2);
|
int match = FindViewSectorInScene(tsectnum, VIEW_LEVEL2);
|
||||||
|
@ -1098,7 +1096,7 @@ void CollectPortals()
|
||||||
// got something!
|
// got something!
|
||||||
fp.othersector = tsectnum;
|
fp.othersector = tsectnum;
|
||||||
fp.offset = { tx, ty, tz };
|
fp.offset = { tx, ty, tz };
|
||||||
fp.offset -= sprite[spr].pos;
|
fp.offset -= actor->s().pos;
|
||||||
goto nextcg;
|
goto nextcg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue