- operatesprite cleanup

This commit is contained in:
Christoph Oelckers 2021-11-13 21:02:24 +01:00
parent 1e27f067ad
commit 959405ecb0
2 changed files with 15 additions and 14 deletions

View file

@ -689,7 +689,6 @@ boolean prepareboard(const char* fname) {
spr.shade = -17; spr.shade = -17;
spr.pal = 0; spr.pal = 0;
spr.detail = GYSERTYPE; spr.detail = GYSERTYPE;
// changespritestat(i,DORMANT);
break; break;
case PATROLPOINT: case PATROLPOINT:
spr.xrepeat = 24; spr.xrepeat = 24;
@ -698,7 +697,7 @@ boolean prepareboard(const char* fname) {
spr.cstat &= ~3; spr.cstat &= ~3;
spr.cstat |= 0x8000; spr.cstat |= 0x8000;
spr.clipdist = 4; spr.clipdist = 4;
changespritestat(i, APATROLPOINT); ChangeActorStat(actor, APATROLPOINT);
break; break;
case BARREL: case BARREL:
case VASEA: case VASEA:

View file

@ -25,18 +25,20 @@ int dragx1[16], dragy1[16], dragx2[16], dragy2[16], dragfloorz[16];
void operatesprite(PLAYER& plr, short s) { void operatesprite(PLAYER& plr, short s) {
if (sprite[s].picnum == SPAWNFIREBALL) auto actor = &whActors[s];
auto& spr = actor->s();
if (spr.picnum == SPAWNFIREBALL)
newstatus(s, DEVILFIRE); newstatus(s, DEVILFIRE);
if (sprite[s].picnum == SPAWNJAVLIN) if (spr.picnum == SPAWNJAVLIN)
trowajavlin(s); trowajavlin(s);
switch (sprite[s].picnum) { switch (spr.picnum) {
case STONEGONZOCHM: case STONEGONZOCHM:
case STONEGONZOGSH: case STONEGONZOGSH:
case STONEGRONDOVAL: case STONEGRONDOVAL:
case STONEGONZOBSW: case STONEGONZOBSW:
sprite[s].lotag *= 120; spr.lotag *= 120;
changespritestat((short) s, STONETOFLESH); ChangeActorStat(actor, STONETOFLESH);
break; break;
case GONZOHMJUMP: case GONZOHMJUMP:
case GONZOSHJUMP: case GONZOSHJUMP:
@ -51,7 +53,7 @@ void operatesprite(PLAYER& plr, short s) {
case STAINCIRCLE: case STAINCIRCLE:
case STAINQ: case STAINQ:
case STAINSCENE: case STAINSCENE:
switch (sprite[s].lotag) { switch (spr.lotag) {
case 2: case 2:
spritesound(S_GLASSBREAK1 + (rand() % 3), &sprite[s]); spritesound(S_GLASSBREAK1 + (rand() % 3), &sprite[s]);
for (int j = 0; j < 20; j++) { for (int j = 0; j < 20; j++) {
@ -63,17 +65,17 @@ void operatesprite(PLAYER& plr, short s) {
break; break;
} }
if ((sprite[s].lotag == 1800 || sprite[s].lotag == 1810 || sprite[s].lotag == 1820) if ((spr.lotag == 1800 || spr.lotag == 1810 || spr.lotag == 1820)
&& sprite[s].sectnum == plr.sector) { && spr.sectnum == plr.sector) {
for (short j = 0; j < MAXSPRITES; j++) { for (short j = 0; j < MAXSPRITES; j++) {
if (sprite[s].sectnum == sprite[j].sectnum && (sprite[j].lotag >= 1800 && sprite[j].lotag <= 1899)) if (spr.sectnum == sprite[j].sectnum && (sprite[j].lotag >= 1800 && sprite[j].lotag <= 1899))
newstatus(j, LIFTDN); newstatus(j, LIFTDN);
} }
} }
if ((sprite[s].lotag == 1801 || sprite[s].lotag == 1811 || sprite[s].lotag == 1821) if ((spr.lotag == 1801 || spr.lotag == 1811 || spr.lotag == 1821)
&& sprite[s].sectnum == plr.sector) { && spr.sectnum == plr.sector) {
for (short j = 0; j < MAXSPRITES; j++) { for (short j = 0; j < MAXSPRITES; j++) {
if (sprite[s].sectnum == sprite[j].sectnum && (sprite[j].lotag >= 1800 && sprite[j].lotag <= 1899)) if (spr.sectnum == sprite[j].sectnum && (sprite[j].lotag >= 1800 && sprite[j].lotag <= 1899))
newstatus(j, LIFTUP); newstatus(j, LIFTUP);
} }
} }