- rr_specialstats, rrra_specialstats and respawn_rrra.

(These look a lot better now. :) )
This commit is contained in:
Christoph Oelckers 2020-10-12 22:20:56 +02:00
parent 69e6bee64a
commit a3601e59ef

View file

@ -792,47 +792,48 @@ int ifhitbyweapon_r(int sn)
void respawn_rrra(int i, int j) void respawn_rrra(int i, int j)
{ {
sprite[j].pal = sprite[i].pal; auto newspr = &sprite[j];
if (sprite[j].picnum == MAMA) newspr->pal = sprite[i].pal;
if (newspr->picnum == MAMA)
{ {
if (sprite[j].pal == 30) if (newspr->pal == 30)
{ {
sprite[j].xrepeat = 26; newspr->xrepeat = 26;
sprite[j].yrepeat = 26; newspr->yrepeat = 26;
sprite[j].clipdist = 75; newspr->clipdist = 75;
} }
else if (sprite[j].pal == 31) else if (newspr->pal == 31)
{ {
sprite[j].xrepeat = 36; newspr->xrepeat = 36;
sprite[j].yrepeat = 36; newspr->yrepeat = 36;
sprite[j].clipdist = 100; newspr->clipdist = 100;
} }
else if (sprite[j].pal == 32) else if (newspr->pal == 32)
{ {
sprite[j].xrepeat = 50; newspr->xrepeat = 50;
sprite[j].yrepeat = 50; newspr->yrepeat = 50;
sprite[j].clipdist = 100; newspr->clipdist = 100;
} }
else else
{ {
sprite[j].xrepeat = 50; newspr->xrepeat = 50;
sprite[j].yrepeat = 50; newspr->yrepeat = 50;
sprite[j].clipdist = 100; newspr->clipdist = 100;
} }
} }
if (sprite[j].pal == 8) if (newspr->pal == 8)
{ {
sprite[j].cstat |= 2; newspr->cstat |= 2;
} }
if (sprite[j].pal != 6) if (newspr->pal != 6)
{ {
deletesprite(i); deletesprite(i);
return; return;
} }
sprite[i].extra = (66 - 13); sprite[i].extra = (66 - 13);
sprite[j].pal = 0; newspr->pal = 0;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -1679,8 +1680,8 @@ void moveweapons_r(void)
void movetransports_r(void) void movetransports_r(void)
{ {
char warpdir, warpspriteto; char warpdir, warpspriteto;
short i, j, k, p, sect, sectlotag; short k, p, sect, sectlotag;
int ll2, ll, onfloorz; int i, j, ll2, ll, onfloorz;
//Transporters //Transporters
@ -2073,64 +2074,62 @@ void movetransports_r(void)
static void rrra_specialstats() static void rrra_specialstats()
{ {
int i, j, nexti; int i, j;
i = headspritestat[117]; StatIterator it(117);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].hitag > 2) if (s->hitag > 2)
sprite[i].hitag = 0; s->hitag = 0;
if ((sprite[i].picnum == RRTILE8488 || sprite[i].picnum == RRTILE8490) && sprite[i].hitag != 2) if ((s->picnum == RRTILE8488 || s->picnum == RRTILE8490) && s->hitag != 2)
{ {
sprite[i].hitag = 2; s->hitag = 2;
sprite[i].extra = -100; s->extra = -100;
} }
if (sprite[i].hitag == 0) if (s->hitag == 0)
{ {
sprite[i].extra++; s->extra++;
if (sprite[i].extra >= 30) if (s->extra >= 30)
sprite[i].hitag = 1; s->hitag = 1;
} }
else if (sprite[i].hitag == 1) else if (s->hitag == 1)
{ {
sprite[i].extra--; s->extra--;
if (sprite[i].extra <= -30) if (s->extra <= -30)
sprite[i].hitag = 0; s->hitag = 0;
} }
else if (sprite[i].hitag == 2) else if (s->hitag == 2)
{ {
sprite[i].extra--; s->extra--;
if (sprite[i].extra <= -104) if (s->extra <= -104)
{ {
fi.spawn(i, sprite[i].lotag); fi.spawn(i, s->lotag);
deletesprite(i); deletesprite(i);
} }
} }
j = fi.movesprite(i, 0, 0, sprite[i].extra * 2, CLIPMASK0); j = fi.movesprite(i, 0, 0, s->extra * 2, CLIPMASK0);
i = nexti;
} }
i = headspritestat[118]; it.Reset(118);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].hitag > 1) if (s->hitag > 1)
sprite[i].hitag = 0; s->hitag = 0;
if (sprite[i].hitag == 0) if (s->hitag == 0)
{ {
sprite[i].extra++; s->extra++;
if (sprite[i].extra >= 20) if (s->extra >= 20)
sprite[i].hitag = 1; s->hitag = 1;
} }
else if (sprite[i].hitag == 1) else if (s->hitag == 1)
{ {
sprite[i].extra--; s->extra--;
if (sprite[i].extra <= -20) if (s->extra <= -20)
sprite[i].hitag = 0; s->hitag = 0;
} }
j = fi.movesprite(i, 0, 0, sprite[i].extra, CLIPMASK0); j = fi.movesprite(i, 0, 0, s->extra, CLIPMASK0);
i = nexti;
} }
if (ps[screenpeek].MamaEnd > 0) if (ps[screenpeek].MamaEnd > 0)
@ -2147,7 +2146,8 @@ static void rrra_specialstats()
short ti; short ti;
for (ti = 0; ti < MAXSPRITES; ti++) for (ti = 0; ti < MAXSPRITES; ti++)
{ {
switch (sprite[ti].picnum) auto tispr = &sprite[ti];
switch (tispr->picnum)
{ {
//case 4049: //case 4049:
//case 4050: //case 4050:
@ -2189,89 +2189,88 @@ static void rrra_specialstats()
case MAMA: case MAMA:
if (enemysizecheat == 3) if (enemysizecheat == 3)
{ {
sprite[ti].xrepeat = sprite[ti].xrepeat << 1; tispr->xrepeat = tispr->xrepeat << 1;
sprite[ti].yrepeat = sprite[ti].yrepeat << 1; tispr->yrepeat = tispr->yrepeat << 1;
sprite[ti].clipdist = mulscale7(sprite[ti].xrepeat, tilesiz[sprite[ti].picnum].x); tispr->clipdist = mulscale7(tispr->xrepeat, tilesiz[tispr->picnum].x);
} }
else if (enemysizecheat == 2) else if (enemysizecheat == 2)
{ {
sprite[ti].xrepeat = sprite[ti].xrepeat >> 1; tispr->xrepeat = tispr->xrepeat >> 1;
sprite[ti].yrepeat = sprite[ti].yrepeat >> 1; tispr->yrepeat = tispr->yrepeat >> 1;
sprite[ti].clipdist = mulscale7(sprite[ti].xrepeat, tilesiz[sprite[ti].picnum].y); tispr->clipdist = mulscale7(tispr->xrepeat, tilesiz[tispr->picnum].y);
} }
break; break;
} }
} }
enemysizecheat = 0; enemysizecheat = 0;
} }
i = headspritestat[121]; it.Reset(121);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
sprite[i].extra++; s->extra++;
if (sprite[i].extra < 100) if (s->extra < 100)
{ {
if (sprite[i].extra == 90) if (s->extra == 90)
{ {
sprite[i].picnum--; s->picnum--;
if (sprite[i].picnum < PIG + 7) if (s->picnum < PIG + 7)
sprite[i].picnum = PIG + 7; s->picnum = PIG + 7;
sprite[i].extra = 1; s->extra = 1;
} }
fi.movesprite(i, 0, 0, -300, CLIPMASK0); fi.movesprite(i, 0, 0, -300, CLIPMASK0);
if (sector[sprite[i].sectnum].ceilingz + (4 << 8) > sprite[i].z) if (sector[s->sectnum].ceilingz + (4 << 8) > s->z)
{ {
sprite[i].picnum = 0; s->picnum = 0;
sprite[i].extra = 100; s->extra = 100;
} }
} }
else if (sprite[i].extra == 200) else if (s->extra == 200)
{ {
setsprite(i, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - 10); setsprite(i, s->x, s->y, sector[s->sectnum].floorz - 10);
sprite[i].extra = 1; s->extra = 1;
sprite[i].picnum = PIG + 11; s->picnum = PIG + 11;
fi.spawn(i, TRANSPORTERSTAR); fi.spawn(i, TRANSPORTERSTAR);
} }
i = nexti;
} }
i = headspritestat[119]; it.Reset(119);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].hitag > 0) if (s->hitag > 0)
{ {
if (sprite[i].extra == 0) if (s->extra == 0)
{ {
sprite[i].hitag--; s->hitag--;
sprite[i].extra = 150; s->extra = 150;
fi.spawn(i, RABBIT); fi.spawn(i, RABBIT);
} }
else else
sprite[i].extra--; s->extra--;
} }
i = nexti;
} }
i = headspritestat[116]; it.Reset(116);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].extra) if (s->extra)
{ {
if (sprite[i].extra == sprite[i].lotag) if (s->extra == s->lotag)
S_PlaySound(183); S_PlaySound(183);
sprite[i].extra--; s->extra--;
j = fi.movesprite(i, j = fi.movesprite(i,
(sprite[i].hitag * sintable[(sprite[i].ang + 512) & 2047]) >> 14, (s->hitag * sintable[(s->ang + 512) & 2047]) >> 14,
(sprite[i].hitag * sintable[sprite[i].ang & 2047]) >> 14, (s->hitag * sintable[s->ang & 2047]) >> 14,
sprite[i].hitag << 1, CLIPMASK0); s->hitag << 1, CLIPMASK0);
if (j > 0) if (j > 0)
{ {
S_PlayActorSound(PIPEBOMB_EXPLODE, i); S_PlayActorSound(PIPEBOMB_EXPLODE, i);
deletesprite(i); deletesprite(i);
} }
if (sprite[i].extra == 0) if (s->extra == 0)
{ {
S_PlaySound(215); S_PlaySound(215);
deletesprite(i); deletesprite(i);
@ -2279,35 +2278,34 @@ static void rrra_specialstats()
SetPlayerPal(&ps[myconnectindex], PalEntry(32, 32, 32, 48)); SetPlayerPal(&ps[myconnectindex], PalEntry(32, 32, 32, 48));
} }
} }
i = nexti;
} }
i = headspritestat[115]; it.Reset(115);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].extra) if (s->extra)
{ {
if (sprite[i].picnum != RRTILE8162) if (s->picnum != RRTILE8162)
sprite[i].picnum = RRTILE8162; s->picnum = RRTILE8162;
sprite[i].extra--; s->extra--;
if (sprite[i].extra == 0) if (s->extra == 0)
{ {
int rvar; int rvar;
rvar = krand() & 127; rvar = krand() & 127;
if (rvar < 96) if (rvar < 96)
{ {
sprite[i].picnum = RRTILE8162 + 3; s->picnum = RRTILE8162 + 3;
} }
else if (rvar < 112) else if (rvar < 112)
{ {
if (ps[screenpeek].SlotWin & 1) if (ps[screenpeek].SlotWin & 1)
{ {
sprite[i].picnum = RRTILE8162 + 3; s->picnum = RRTILE8162 + 3;
} }
else else
{ {
sprite[i].picnum = RRTILE8162 + 2; s->picnum = RRTILE8162 + 2;
fi.spawn(i, BATTERYAMMO); fi.spawn(i, BATTERYAMMO);
ps[screenpeek].SlotWin |= 1; ps[screenpeek].SlotWin |= 1;
S_PlayActorSound(52, i); S_PlayActorSound(52, i);
@ -2317,11 +2315,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 2) if (ps[screenpeek].SlotWin & 2)
{ {
sprite[i].picnum = RRTILE8162 + 3; s->picnum = RRTILE8162 + 3;
} }
else else
{ {
sprite[i].picnum = RRTILE8162 + 6; s->picnum = RRTILE8162 + 6;
fi.spawn(i, HEAVYHBOMB); fi.spawn(i, HEAVYHBOMB);
ps[screenpeek].SlotWin |= 2; ps[screenpeek].SlotWin |= 2;
S_PlayActorSound(52, i); S_PlayActorSound(52, i);
@ -2331,11 +2329,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 4) if (ps[screenpeek].SlotWin & 4)
{ {
sprite[i].picnum = RRTILE8162 + 3; s->picnum = RRTILE8162 + 3;
} }
else else
{ {
sprite[i].picnum = RRTILE8162 + 5; s->picnum = RRTILE8162 + 5;
fi.spawn(i, SIXPAK); fi.spawn(i, SIXPAK);
ps[screenpeek].SlotWin |= 4; ps[screenpeek].SlotWin |= 4;
S_PlayActorSound(52, i); S_PlayActorSound(52, i);
@ -2345,11 +2343,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 8) if (ps[screenpeek].SlotWin & 8)
{ {
sprite[i].picnum = RRTILE8162 + 3; s->picnum = RRTILE8162 + 3;
} }
else else
{ {
sprite[i].picnum = RRTILE8162 + 4; s->picnum = RRTILE8162 + 4;
fi.spawn(i, ATOMICHEALTH); fi.spawn(i, ATOMICHEALTH);
ps[screenpeek].SlotWin |= 8; ps[screenpeek].SlotWin |= 8;
S_PlayActorSound(52, i); S_PlayActorSound(52, i);
@ -2357,35 +2355,34 @@ static void rrra_specialstats()
} }
} }
} }
i = nexti;
} }
i = headspritestat[122]; it.Reset(122);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].extra) if (s->extra)
{ {
if (sprite[i].picnum != RRTILE8589) if (s->picnum != RRTILE8589)
sprite[i].picnum = RRTILE8589; s->picnum = RRTILE8589;
sprite[i].extra--; s->extra--;
if (sprite[i].extra == 0) if (s->extra == 0)
{ {
int rvar; int rvar;
rvar = krand() & 127; rvar = krand() & 127;
if (rvar < 96) if (rvar < 96)
{ {
sprite[i].picnum = RRTILE8589 + 4; s->picnum = RRTILE8589 + 4;
} }
else if (rvar < 112) else if (rvar < 112)
{ {
if (ps[screenpeek].SlotWin & 1) if (ps[screenpeek].SlotWin & 1)
{ {
sprite[i].picnum = RRTILE8589 + 4; s->picnum = RRTILE8589 + 4;
} }
else else
{ {
sprite[i].picnum = RRTILE8589 + 5; s->picnum = RRTILE8589 + 5;
fi.spawn(i, BATTERYAMMO); fi.spawn(i, BATTERYAMMO);
ps[screenpeek].SlotWin |= 1; ps[screenpeek].SlotWin |= 1;
S_PlayActorSound(342, i); S_PlayActorSound(342, i);
@ -2395,11 +2392,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 2) if (ps[screenpeek].SlotWin & 2)
{ {
sprite[i].picnum = RRTILE8589 + 4; s->picnum = RRTILE8589 + 4;
} }
else else
{ {
sprite[i].picnum = RRTILE8589 + 6; s->picnum = RRTILE8589 + 6;
fi.spawn(i, HEAVYHBOMB); fi.spawn(i, HEAVYHBOMB);
ps[screenpeek].SlotWin |= 2; ps[screenpeek].SlotWin |= 2;
S_PlayActorSound(342, i); S_PlayActorSound(342, i);
@ -2409,11 +2406,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 4) if (ps[screenpeek].SlotWin & 4)
{ {
sprite[i].picnum = RRTILE8589 + 4; s->picnum = RRTILE8589 + 4;
} }
else else
{ {
sprite[i].picnum = RRTILE8589 + 2; s->picnum = RRTILE8589 + 2;
fi.spawn(i, SIXPAK); fi.spawn(i, SIXPAK);
ps[screenpeek].SlotWin |= 4; ps[screenpeek].SlotWin |= 4;
S_PlayActorSound(342, i); S_PlayActorSound(342, i);
@ -2423,11 +2420,11 @@ static void rrra_specialstats()
{ {
if (ps[screenpeek].SlotWin & 8) if (ps[screenpeek].SlotWin & 8)
{ {
sprite[i].picnum = RRTILE8589 + 4; s->picnum = RRTILE8589 + 4;
} }
else else
{ {
sprite[i].picnum = RRTILE8589 + 3; s->picnum = RRTILE8589 + 3;
fi.spawn(i, ATOMICHEALTH); fi.spawn(i, ATOMICHEALTH);
ps[screenpeek].SlotWin |= 8; ps[screenpeek].SlotWin |= 8;
S_PlayActorSound(342, i); S_PlayActorSound(342, i);
@ -2435,17 +2432,15 @@ static void rrra_specialstats()
} }
} }
} }
i = nexti;
} }
i = headspritestat[123]; it.Reset(123);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].lotag == 5) if (s->lotag == 5)
if (!S_CheckSoundPlaying(330)) if (!S_CheckSoundPlaying(330))
S_PlayActorSound(330, i); S_PlayActorSound(330, i);
i = nexti;
} }
} }
@ -2458,201 +2453,192 @@ static void rrra_specialstats()
void rr_specialstats() void rr_specialstats()
{ {
int x; int x;
int i, j, nexti, nextj, p, pi; int i, j, nextj, p, pi;
spritetype* s;
unsigned short pst; unsigned short pst;
i = headspritestat[107]; StatIterator it(107);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].hitag == 100) if (s->hitag == 100)
{ {
sprite[i].z += (4 << 8); s->z += (4 << 8);
if (sprite[i].z >= sector[sprite[i].sectnum].floorz + 15168) if (s->z >= sector[s->sectnum].floorz + 15168)
sprite[i].z = sector[sprite[i].sectnum].floorz + 15168; s->z = sector[s->sectnum].floorz + 15168;
} }
if (sprite[i].picnum == LUMBERBLADE) if (s->picnum == LUMBERBLADE)
{ {
sprite[i].extra++; s->extra++;
if (sprite[i].extra == 192) if (s->extra == 192)
{ {
sprite[i].hitag = 0; s->hitag = 0;
sprite[i].z = sector[sprite[i].sectnum].floorz - 15168; s->z = sector[s->sectnum].floorz - 15168;
sprite[i].extra = 0; s->extra = 0;
sprite[i].picnum = RRTILE3410; s->picnum = RRTILE3410;
j = headspritestat[STAT_DEFAULT]; StatIterator itj(STAT_DEFAULT);
while (j >= 0) while ((j = itj.NextIndex()) >= 0)
{ {
nextj = nextspritestat[j]; auto sprj = &sprite[j];
if (sprite[j].picnum == 128) if (sprj->picnum == 128)
if (sprite[j].hitag == 999) if (sprj->hitag == 999)
sprite[j].picnum = 127; sprj->picnum = 127;
j = nextj;
} }
} }
} }
i = nexti;
} }
if (chickenplant) if (chickenplant)
{ {
i = headspritestat[106]; it.Reset(106);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
switch (sprite[i].picnum) switch (s->picnum)
{ {
case RRTILE285: case RRTILE285:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3190); j = fi.spawn(i, RRTILE3190);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 128; s->lotag = 128;
} }
break; break;
case RRTILE286: case RRTILE286:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3192); j = fi.spawn(i, RRTILE3192);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 256; s->lotag = 256;
} }
break; break;
case RRTILE287: case RRTILE287:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
lotsoffeathers_r(&sprite[i], (krand() & 3) + 4); lotsoffeathers_r(&sprite[i], (krand() & 3) + 4);
sprite[i].lotag = 84; s->lotag = 84;
} }
break; break;
case RRTILE288: case RRTILE288:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3132); j = fi.spawn(i, RRTILE3132);
sprite[i].lotag = 96; s->lotag = 96;
if (!isRRRA()) S_PlayActorSound(472, j); if (!isRRRA()) S_PlayActorSound(472, j);
} }
break; break;
case RRTILE289: case RRTILE289:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3120); j = fi.spawn(i, RRTILE3120);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 448; s->lotag = 448;
} }
break; break;
case RRTILE290: case RRTILE290:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3122); j = fi.spawn(i, RRTILE3122);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 64; s->lotag = 64;
} }
break; break;
case RRTILE291: case RRTILE291:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3123); j = fi.spawn(i, RRTILE3123);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 512; s->lotag = 512;
} }
break; break;
case RRTILE292: case RRTILE292:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
j = fi.spawn(i, RRTILE3124); j = fi.spawn(i, RRTILE3124);
sprite[j].ang = sprite[i].ang; sprite[j].ang = s->ang;
sprite[i].lotag = 224; s->lotag = 224;
} }
break; break;
case RRTILE293: case RRTILE293:
sprite[i].lotag--; s->lotag--;
if (sprite[i].lotag < 0) if (s->lotag < 0)
{ {
guts_r(&sprite[i], JIBS1, 1, myconnectindex); guts_r(&sprite[i], JIBS1, 1, myconnectindex);
guts_r(&sprite[i], JIBS2, 1, myconnectindex); guts_r(&sprite[i], JIBS2, 1, myconnectindex);
guts_r(&sprite[i], JIBS3, 1, myconnectindex); guts_r(&sprite[i], JIBS3, 1, myconnectindex);
guts_r(&sprite[i], JIBS4, 1, myconnectindex); guts_r(&sprite[i], JIBS4, 1, myconnectindex);
sprite[i].lotag = 256; s->lotag = 256;
} }
break; break;
} }
i = nexti;
} }
} }
i = headspritestat[105]; it.Reset(105);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
if (sprite[i].picnum == RRTILE280) if (s->picnum == RRTILE280)
if (sprite[i].lotag == 100) if (s->lotag == 100)
{ {
pst = pinsectorresetup(sprite[i].sectnum); pst = pinsectorresetup(s->sectnum);
if (pst) if (pst)
{ {
sprite[i].lotag = 0; s->lotag = 0;
if (sprite[i].extra == 1) if (s->extra == 1)
{ {
pst = checkpins(sprite[i].sectnum); pst = checkpins(s->sectnum);
if (!pst) if (!pst)
{ {
sprite[i].extra = 2; s->extra = 2;
} }
} }
if (sprite[i].extra == 2) if (s->extra == 2)
{ {
sprite[i].extra = 0; s->extra = 0;
resetpins(sprite[i].sectnum); resetpins(s->sectnum);
} }
} }
} }
i = nexti;
} }
i = headspritestat[108]; it.Reset(108);
while (i >= 0) while ((i = it.NextIndex()) >= 0)
{ {
nexti = nextspritestat[i]; auto s = &sprite[i];
s = &sprite[i];
if (s->picnum == RRTILE296) if (s->picnum == RRTILE296)
{ {
p = findplayer(s, &x); p = findplayer(s, &x);
if (x < 2047) if (x < 2047)
{ {
j = headspritestat[108]; StatIterator itj(108);
while (j >= 0) while ((j = itj.NextIndex()) >= 0)
{ {
nextj = nextspritestat[j]; auto sprj = &sprite[j];
if (sprite[j].picnum == RRTILE297) if (sprj->picnum == RRTILE297)
{ {
ps[p].angle.ang = buildang(sprite[j].ang); ps[p].angle.ang = buildang(sprj->ang);
ps[p].bobposx = ps[p].oposx = ps[p].posx = sprite[j].x; ps[p].bobposx = ps[p].oposx = ps[p].posx = sprj->x;
ps[p].bobposy = ps[p].oposy = ps[p].posy = sprite[j].y; ps[p].bobposy = ps[p].oposy = ps[p].posy = sprj->y;
ps[p].oposz = ps[p].posz = sprite[j].z - (36 << 8); ps[p].oposz = ps[p].posz = sprj->z - (36 << 8);
pi = ps[p].i; pi = ps[p].i;
changespritesect(pi, sprite[j].sectnum); changespritesect(pi, sprj->sectnum);
ps[p].cursectnum = sprite[pi].sectnum; ps[p].cursectnum = sprite[pi].sectnum;
S_PlayActorSound(70, j); S_PlayActorSound(70, j);
deletesprite(j); deletesprite(j);
} }
j = nextj;
} }
} }
} }
i = nexti;
} }
} }