- checkhitswitch_r part 4

This commit is contained in:
Christoph Oelckers 2020-10-26 07:10:45 +01:00
parent 4ce19b74b0
commit 3e7c8adc1e

View file

@ -552,19 +552,18 @@ bool checkhitswitch_r(int snum, int w, int switchtype)
if (si->picnum == DIPSWITCH3) if (si->picnum == DIPSWITCH3)
if (si->hitag == 999) if (si->hitag == 999)
{ {
int j; DukeStatIterator it1(107);
StatIterator it1(107); while (auto other2 = it1.Next())
while ((j = it1.NextIndex()) >= 0)
{ {
if (sprite[j].picnum == RRTILE3410) if (other2->s.picnum == RRTILE3410)
{ {
sprite[j].picnum++; other2->s.picnum++;
sprite[j].hitag = 100; other2->s.hitag = 100;
sprite[j].extra = 0; other2->s.extra = 0;
S_PlayActorSound(474, j); S_PlayActorSound(474, other2);
} }
else if (sprite[j].picnum == RRTILE295) else if (other2->s.picnum == RRTILE295)
deletesprite(j); deletesprite(other2);
} }
si->picnum++; si->picnum++;
break; break;