- handle the remaining SectIterators.

This commit is contained in:
Christoph Oelckers 2021-11-06 09:31:19 +01:00
parent df5d980f79
commit 66e61d799d
2 changed files with 9 additions and 10 deletions

View file

@ -592,16 +592,15 @@ int DoSlidor(DSWActor* actor)
// if heading for the OFF (original) position and should NOT CRUSH
if (TEST_BOOL3(sp) && r->tgt == 0)
{
int i;
SPRITEp bsp;
USERp bu;
bool found = false;
SectIterator it(sp->sectnum);
while ((i = it.NextIndex()) >= 0)
SWSectIterator it(sp->sectnum);
while (auto itActor = it.Next())
{
bsp = &sprite[i];
bu = User[i].Data();
bsp = &itActor->s();
bu = itActor->u();
if (bu && TEST(bsp->cstat, CSTAT_SPRITE_BLOCK) && TEST(bsp->extra, SPRX_PLAYER_OR_ENEMY))
{

View file

@ -4685,10 +4685,10 @@ getzrangepoint(int x, int y, int z, short sectnum,
*florhit = sectnum + 16384;
// Go through sprites of only the current sector
SectIterator it(sectnum);
while ((j = it.NextIndex()) >= 0)
SWSectIterator it(sectnum);
while (auto itActor = it.Next())
{
spr = &sprite[j];
spr = &itActor->s();
cstat = spr->cstat;
if ((cstat & 49) != 33)
continue; // Only check blocking floor sprites
@ -4771,7 +4771,7 @@ getzrangepoint(int x, int y, int z, short sectnum,
if (daz > *ceilz)
{
*ceilz = daz;
*ceilhit = j + 49152;
*ceilhit = itActor->GetSpriteIndex() + HIT_SPRITE;
}
}
else
@ -4779,7 +4779,7 @@ getzrangepoint(int x, int y, int z, short sectnum,
if (daz < *florz)
{
*florz = daz;
*florhit = j + 49152;
*florhit = itActor->GetSpriteIndex() + HIT_SPRITE;
}
}
}