- variable renaming for clarity.

This commit is contained in:
Christoph Oelckers 2020-10-24 10:13:21 +02:00
parent b03a637e10
commit cf8da6c6e3

View file

@ -366,7 +366,7 @@ void movedummyplayers(void)
while ((i = iti.NextIndex()) >= 0) while ((i = iti.NextIndex()) >= 0)
{ {
auto spri = &sprite[i]; auto spri = &sprite[i];
auto hti = &hittype[i]; auto act = &hittype[i];
p = sprite[spri->owner].yvel; p = sprite[spri->owner].yvel;
if ((!isRR() && ps[p].on_crane != nullptr) || sector[ps[p].cursectnum].lotag != 1 || sprite[ps[p].i].extra <= 0) if ((!isRR() && ps[p].on_crane != nullptr) || sector[ps[p].cursectnum].lotag != 1 || sprite[ps[p].i].extra <= 0)
@ -382,9 +382,9 @@ void movedummyplayers(void)
spri->cstat = CSTAT_SPRITE_BLOCK_ALL; spri->cstat = CSTAT_SPRITE_BLOCK_ALL;
spri->z = sector[spri->sectnum].ceilingz + (27 << 8); spri->z = sector[spri->sectnum].ceilingz + (27 << 8);
spri->ang = ps[p].angle.ang.asbuild(); spri->ang = ps[p].angle.ang.asbuild();
if (hti->temp_data[0] == 8) if (act->temp_data[0] == 8)
hti->temp_data[0] = 0; act->temp_data[0] = 0;
else hti->temp_data[0]++; else act->temp_data[0]++;
} }
else else
{ {
@ -413,35 +413,35 @@ void moveplayers(void) //Players
StatIterator iti(STAT_PLAYER); StatIterator iti(STAT_PLAYER);
while ((i = iti.NextIndex()) >= 0) while ((i = iti.NextIndex()) >= 0)
{ {
auto s = &sprite[i]; auto spri = &sprite[i];
auto ht = &hittype[i]; auto act = &hittype[i];
auto p = &ps[s->yvel]; auto p = &ps[spri->yvel];
if (s->owner >= 0) if (spri->owner >= 0)
{ {
if (p->newowner >= 0) //Looking thru the camera if (p->newowner >= 0) //Looking thru the camera
{ {
s->x = p->oposx; spri->x = p->oposx;
s->y = p->oposy; spri->y = p->oposy;
ht->bposz = s->z = p->oposz + PHEIGHT; act->bposz = spri->z = p->oposz + PHEIGHT;
s->ang = p->angle.oang.asbuild(); spri->ang = p->angle.oang.asbuild();
setsprite(i, s->x, s->y, s->z); setsprite(i, spri->x, spri->y, spri->z);
} }
else else
{ {
if (ud.multimode > 1) if (ud.multimode > 1)
otherp = findotherplayer(s->yvel, &otherx); otherp = findotherplayer(spri->yvel, &otherx);
else else
{ {
otherp = s->yvel; otherp = spri->yvel;
otherx = 0; otherx = 0;
} }
execute(i, s->yvel, otherx); execute(i, spri->yvel, otherx);
if (ud.multimode > 1) if (ud.multimode > 1)
if (sprite[ps[otherp].i].extra > 0) if (sprite[ps[otherp].i].extra > 0)
{ {
if (s->yrepeat > 32 && sprite[ps[otherp].i].yrepeat < 32) if (spri->yrepeat > 32 && sprite[ps[otherp].i].yrepeat < 32)
{ {
if (otherx < 1400 && p->knee_incs == 0) if (otherx < 1400 && p->knee_incs == 0)
{ {
@ -454,8 +454,8 @@ void moveplayers(void) //Players
if (ud.god) if (ud.god)
{ {
s->extra = max_player_health; spri->extra = max_player_health;
s->cstat = 257; spri->cstat = 257;
if (!isWW2GI() && !isRR()) if (!isWW2GI() && !isRR())
p->jetpack_amount = 1599; p->jetpack_amount = 1599;
} }
@ -465,21 +465,21 @@ void moveplayers(void) //Players
p->angle.addadjustment(FixedToFloat(getincangleq16(p->angle.ang.asq16(), gethiq16angle(p->actorsqu->s.x - p->posx, p->actorsqu->s.y - p->posy)) >> 2)); p->angle.addadjustment(FixedToFloat(getincangleq16(p->angle.ang.asq16(), gethiq16angle(p->actorsqu->s.x - p->posx, p->actorsqu->s.y - p->posy)) >> 2));
} }
if (s->extra > 0) if (spri->extra > 0)
{ {
// currently alive... // currently alive...
ht->owner = i; act->owner = i;
if (ud.god == 0) if (ud.god == 0)
if (fi.ceilingspace(s->sectnum) || fi.floorspace(s->sectnum)) if (fi.ceilingspace(spri->sectnum) || fi.floorspace(spri->sectnum))
quickkill(p); quickkill(p);
} }
else else
{ {
p->posx = s->x; p->posx = spri->x;
p->posy = s->y; p->posy = spri->y;
p->posz = s->z - (20 << 8); p->posz = spri->z - (20 << 8);
p->newowner = -1; p->newowner = -1;
@ -488,7 +488,7 @@ void moveplayers(void) //Players
p->angle.addadjustment(FixedToFloat(getincangleq16(p->angle.ang.asq16(), gethiq16angle(p->wackedbyactor->s.x - p->posx, p->wackedbyactor->s.y - p->posy)) >> 1)); p->angle.addadjustment(FixedToFloat(getincangleq16(p->angle.ang.asq16(), gethiq16angle(p->wackedbyactor->s.x - p->posx, p->wackedbyactor->s.y - p->posy)) >> 1));
} }
} }
s->ang = p->angle.ang.asbuild(); spri->ang = p->angle.ang.asbuild();
} }
} }
else else
@ -499,49 +499,49 @@ void moveplayers(void) //Players
continue; continue;
} }
ht->bposx = s->x; act->bposx = spri->x;
ht->bposy = s->y; act->bposy = spri->y;
ht->bposz = s->z; act->bposz = spri->z;
s->cstat = 0; spri->cstat = 0;
if (s->xrepeat < 42) if (spri->xrepeat < 42)
{ {
s->xrepeat += 4; spri->xrepeat += 4;
s->cstat |= 2; spri->cstat |= 2;
} }
else s->xrepeat = 42; else spri->xrepeat = 42;
if (s->yrepeat < 36) if (spri->yrepeat < 36)
s->yrepeat += 4; spri->yrepeat += 4;
else else
{ {
s->yrepeat = 36; spri->yrepeat = 36;
if (sector[s->sectnum].lotag != ST_2_UNDERWATER) if (sector[spri->sectnum].lotag != ST_2_UNDERWATER)
makeitfall(i); makeitfall(i);
if (s->zvel == 0 && sector[s->sectnum].lotag == ST_1_ABOVE_WATER) if (spri->zvel == 0 && sector[spri->sectnum].lotag == ST_1_ABOVE_WATER)
s->z += (32 << 8); spri->z += (32 << 8);
} }
if (s->extra < 8) if (spri->extra < 8)
{ {
s->xvel = 128; spri->xvel = 128;
s->ang = p->angle.ang.asbuild(); spri->ang = p->angle.ang.asbuild();
s->extra++; spri->extra++;
//IFMOVING; // JBF 20040825: is really "if (ssp(i,CLIPMASK0)) ;" which is probably //IFMOVING; // JBF 20040825: is really "if (ssp(i,CLIPMASK0)) ;" which is probably
ssp(i, CLIPMASK0); // not the safest of ideas because a zealous optimiser probably sees ssp(i, CLIPMASK0); // not the safest of ideas because a zealous optimiser probably sees
// it as redundant, so I'll call the "ssp(i,CLIPMASK0)" explicitly. // it as redundant, so I'll call the "ssp(i,CLIPMASK0)" explicitly.
} }
else else
{ {
s->ang = 2047 - (p->angle.ang.asbuild()); spri->ang = 2047 - (p->angle.ang.asbuild());
setsprite(i, s->x, s->y, s->z); setsprite(i, spri->x, spri->y, spri->z);
} }
} }
if (sector[s->sectnum].ceilingstat & 1) if (sector[spri->sectnum].ceilingstat & 1)
s->shade += (sector[s->sectnum].ceilingshade - s->shade) >> 1; spri->shade += (sector[spri->sectnum].ceilingshade - spri->shade) >> 1;
else else
s->shade += (sector[s->sectnum].floorshade - s->shade) >> 1; spri->shade += (sector[spri->sectnum].floorshade - spri->shade) >> 1;
} }
} }