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

View file

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