- use symbolic STAT_ constants in spawninit where available.

This commit is contained in:
Christoph Oelckers 2022-10-16 17:19:55 +02:00
parent 2c7cf5564f
commit 15fc9e47fd
2 changed files with 38 additions and 38 deletions

View file

@ -96,10 +96,10 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj) { if (actj) {
act->timetosleep = 0; act->timetosleep = 0;
check_fta_sounds_d(act); check_fta_sounds_d(act);
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
} }
else else
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
} }
return act; return act;
case FIREFLYFLYINGEFFECT: case FIREFLYFLYINGEFFECT:
@ -123,7 +123,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.scale = DVector2(0.3125, 0.3125); act->spr.scale = DVector2(0.3125, 0.3125);
return act; return act;
case SERIOUSSAM: case SERIOUSSAM:
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->spr.extra = 150; act->spr.extra = 150;
return act; return act;
@ -206,7 +206,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.pos.Z -= gs.playerheight; act->spr.pos.Z -= gs.playerheight;
act->vel.Z = 1 - krandf(2); act->vel.Z = 1 - krandf(2);
act->vel.X = 4 - krandf(8); act->vel.X = 4 - krandf(8);
ChangeActorStat(act, 4); ChangeActorStat(act, STAT_PROJECTILE);
break; break;
case NATURALLIGHTNING: case NATURALLIGHTNING:
act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
@ -249,7 +249,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (!actj) if (!actj)
{ {
act->spr.cstat = CSTAT_SPRITE_INVISIBLE; act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
} }
else else
{ {
@ -343,7 +343,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.extra = 20; act->spr.extra = 20;
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
} }
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case HYDRENT: case HYDRENT:
@ -495,7 +495,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->clipdist = 8; act->clipdist = 8;
} }
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case DUKELYINGDEAD: case DUKELYINGDEAD:
@ -532,7 +532,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.yint = act->spr.hitag; act->spr.yint = act->spr.hitag;
[[fallthrough]]; [[fallthrough]];
case WEATHERWARN: case WEATHERWARN:
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case SPOTLITE: case SPOTLITE:
@ -560,7 +560,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->SetOwner(act); act->SetOwner(act);
act->spr.lotag = 1; act->spr.lotag = 1;
act->spr.extra = 1; act->spr.extra = 1;
ChangeActorStat(act, 6); ChangeActorStat(act, STAT_STANDABLE);
break; break;
case SHELL: //From the player case SHELL: //From the player
@ -579,7 +579,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break; break;
} }
act->spr.cstat = CSTAT_SPRITE_INVISIBLE; act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
ChangeActorStat(act, 11); ChangeActorStat(act, STAT_FX);
break; break;
case ONFIRE: case ONFIRE:
@ -874,9 +874,9 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
{ {
act->timetosleep = 0; act->timetosleep = 0;
check_fta_sounds_d(act); check_fta_sounds_d(act);
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
} }
else ChangeActorStat(act, 2); else ChangeActorStat(act, STAT_ZOMBIEACTOR);
} }
if (act->spr.picnum == ROTATEGUN) if (act->spr.picnum == ROTATEGUN)
@ -886,7 +886,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case LOCATORS: case LOCATORS:
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
ChangeActorStat(act, 7); ChangeActorStat(act, STAT_LOCATOR);
break; break;
case ACTIVATORLOCKED: case ACTIVATORLOCKED:
@ -894,13 +894,13 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.cstat = CSTAT_SPRITE_INVISIBLE; act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
if (act->spr.picnum == ACTIVATORLOCKED) if (act->spr.picnum == ACTIVATORLOCKED)
act->sector()->lotag |= 16384; act->sector()->lotag |= 16384;
ChangeActorStat(act, 8); ChangeActorStat(act, STAT_ACTIVATOR);
break; break;
case DOORSHOCK: case DOORSHOCK:
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
act->spr.shade = -12; act->spr.shade = -12;
ChangeActorStat(act, 6); ChangeActorStat(act, STAT_STANDABLE);
break; break;
case OOZ: case OOZ:
@ -915,7 +915,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
insertspriteq(act); insertspriteq(act);
} }
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
getglobalz(act); getglobalz(act);
@ -1079,7 +1079,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
else act->spr.pal = 0; else act->spr.pal = 0;
if (act->spr.picnum == CAMERAPOLE || act->spr.picnum == GENERICPOLE) break; if (act->spr.picnum == CAMERAPOLE || act->spr.picnum == GENERICPOLE) break;
act->spr.picnum = CAMERA1; act->spr.picnum = CAMERA1;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case STEAM: case STEAM:
if (actj) if (actj)

View file

@ -92,7 +92,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (!isRRRA()) goto default_case; if (!isRRRA()) goto default_case;
act->spr.extra = 0; act->spr.extra = 0;
act->spr.scale = DVector2(0, 0); act->spr.scale = DVector2(0, 0);
ChangeActorStat(act, 11); ChangeActorStat(act, STAT_FX);
break; break;
case RRTILE7936: case RRTILE7936:
if (!isRRRA()) goto default_case; if (!isRRRA()) goto default_case;
@ -278,7 +278,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.pos.Z -= gs.playerheight; act->spr.pos.Z -= gs.playerheight;
act->vel.Z = 1 - krandf(2); act->vel.Z = 1 - krandf(2);
act->vel.X = 4 - krandf(8); act->vel.X = 4 - krandf(8);
ChangeActorStat(act, 4); ChangeActorStat(act, STAT_PROJECTILE);
break; break;
case TRANSPORTERSTAR: case TRANSPORTERSTAR:
case TRANSPORTERBEAM: case TRANSPORTERBEAM:
@ -303,7 +303,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (!actj) if (!actj)
{ {
act->spr.cstat = CSTAT_SPRITE_INVISIBLE; act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
} }
else else
{ {
@ -443,19 +443,19 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 8; act->clipdist = 8;
} }
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case BOWLINGBALL: case BOWLINGBALL:
act->spr.cstat = CSTAT_SPRITE_BLOCK_HITSCAN; act->spr.cstat = CSTAT_SPRITE_BLOCK_HITSCAN;
act->clipdist = 16; act->clipdist = 16;
act->spr.scale = DVector2(0.171875, 0.140625); act->spr.scale = DVector2(0.171875, 0.140625);
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case HENSTAND: case HENSTAND:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 12; act->clipdist = 12;
act->spr.scale = DVector2(0.328125, 0.234375); act->spr.scale = DVector2(0.328125, 0.234375);
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case RRTILE295: case RRTILE295:
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
@ -474,48 +474,48 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->clipdist = 2; act->clipdist = 2;
act->spr.scale = DVector2(0.5, 0.40625); act->spr.scale = DVector2(0.5, 0.40625);
act->vel.X = 2; act->vel.X = 2;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case RRTILE3120: case RRTILE3120:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 2; act->clipdist = 2;
act->spr.scale = DVector2(0.1875, 0.15625); act->spr.scale = DVector2(0.1875, 0.15625);
act->vel.X = 2; act->vel.X = 2;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case RRTILE3122: case RRTILE3122:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 0.5; act->clipdist = 0.5;
act->spr.scale = DVector2(0.125, 0.09375); act->spr.scale = DVector2(0.125, 0.09375);
act->vel.X = 1; act->vel.X = 1;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case RRTILE3123: case RRTILE3123:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 2; act->clipdist = 2;
act->spr.scale = DVector2(0.203125, 0.203125); act->spr.scale = DVector2(0.203125, 0.203125);
act->vel.X = 1; act->vel.X = 1;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case RRTILE3124: case RRTILE3124:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 2; act->clipdist = 2;
act->spr.scale = DVector2(0.265625, 0.1875); act->spr.scale = DVector2(0.265625, 0.1875);
act->vel.X = 2; act->vel.X = 2;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case RRTILE3132: case RRTILE3132:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 2; act->clipdist = 2;
act->spr.scale = DVector2(0.203125, 0.15625); act->spr.scale = DVector2(0.203125, 0.15625);
act->vel.X = 0; act->vel.X = 0;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case BOWLINGPIN: case BOWLINGPIN:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->clipdist = 12; act->clipdist = 12;
act->spr.scale = DVector2(0.359375, 0.359375); act->spr.scale = DVector2(0.359375, 0.359375);
ChangeActorStat(act, 2); ChangeActorStat(act, STAT_ZOMBIEACTOR);
break; break;
case DUKELYINGDEAD: case DUKELYINGDEAD:
if (actj && actj->spr.picnum == APLAYER) if (actj && actj->spr.picnum == APLAYER)
@ -544,7 +544,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case MIKE: case MIKE:
if (act->spr.picnum == MIKE) if (act->spr.picnum == MIKE)
act->spr.yint = act->spr.hitag; act->spr.yint = act->spr.hitag;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case SPOTLITE: case SPOTLITE:
@ -639,7 +639,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->sector()->lotag != 2) if (act->sector()->lotag != 2)
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
} }
ChangeActorStat(act, 13); ChangeActorStat(act, STAT_DUMMYPLAYER);
break; break;
case APLAYER: case APLAYER:
@ -651,7 +651,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (ud.multimode < 2 || (ud.multimode > 1 && j != act->spr.lotag)) if (ud.multimode < 2 || (ud.multimode > 1 && j != act->spr.lotag))
ChangeActorStat(act, STAT_MISC); ChangeActorStat(act, STAT_MISC);
else else
ChangeActorStat(act, 10); ChangeActorStat(act, STAT_PLAYER);
break; break;
} }
case WATERBUBBLE: case WATERBUBBLE:
@ -679,12 +679,12 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum != WATERDRIP) act->spr.angle = randomAngle(); if (act->spr.picnum != WATERDRIP) act->spr.angle = randomAngle();
act->spr.scale = DVector2(0.375, 0.375); act->spr.scale = DVector2(0.375, 0.375);
ChangeActorStat(act, 6); ChangeActorStat(act, STAT_STANDABLE);
break; break;
case PLUG: case PLUG:
act->spr.lotag = 9999; act->spr.lotag = 9999;
ChangeActorStat(act, 6); ChangeActorStat(act, STAT_STANDABLE);
break; break;
case TOUCHPLATE: case TOUCHPLATE:
act->temp_pos.Z = sectp->floorz; act->temp_pos.Z = sectp->floorz;
@ -1241,7 +1241,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case TIRE: case TIRE:
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; // Make it hitable act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; // Make it hitable
act->spr.extra = 1; act->spr.extra = 1;
ChangeActorStat(act, 6); ChangeActorStat(act, STAT_STANDABLE);
break; break;
case CAMERA1: case CAMERA1:
@ -1264,7 +1264,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
else act->spr.pal = 0; else act->spr.pal = 0;
if (act->spr.picnum == CAMERAPOLE) break; if (act->spr.picnum == CAMERAPOLE) break;
act->spr.picnum = CAMERA1; act->spr.picnum = CAMERA1;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case STEAM: case STEAM:
if (actj) if (actj)
@ -1346,7 +1346,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->saved_ammo = 20; act->saved_ammo = 20;
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->spr.lotag = 1; act->spr.lotag = 1;
ChangeActorStat(act, 1); ChangeActorStat(act, STAT_ACTOR);
break; break;
case TOILET: case TOILET: