From 10e4c90d37a79f55dbcfd81647fc3a2639c4c37e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 2 Dec 2022 22:25:07 +0100 Subject: [PATCH] - minor cleanup. --- source/games/duke/src/actors.cpp | 10 +++++----- source/games/duke/src/spawn_d.cpp | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index b5b873f93..21033ed98 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -969,7 +969,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) while (auto a2 = it.Next()) { if (a2->spr.statnum != STAT_PLAYER && a2->sector()->lotag != 2 && - (a2->spr.picnum != SECTOREFFECTOR || a2->spr.lotag == SE_49_POINT_LIGHT || a2->spr.lotag == SE_50_SPOT_LIGHT) && + (!iseffector(a2) || a2->spr.lotag == SE_49_POINT_LIGHT || a2->spr.lotag == SE_50_SPOT_LIGHT) && !islocator(a2)) { a2->spr.pos.XY() = rotatepoint(actor->spr.pos.XY(), a2->spr.pos.XY(), diffangle) + vec; @@ -1013,7 +1013,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) DukeSectIterator itr(actOwner->sector()); while (auto a2 = itr.Next()) { - if (a2->spr.statnum == 1 && badguy(a2) && a2->spr.picnum != SECTOREFFECTOR && !islocator(a2)) + if (a2->spr.statnum == 1 && badguy(a2) && !iseffector(a2) && !islocator(a2)) { auto k = a2->sector(); updatesector(a2->spr.pos, &k); @@ -1132,7 +1132,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) DukeSectIterator its(actor->sector()); while (auto a2 = its.Next()) { - if (a2->spr.picnum != SECTOREFFECTOR && !islocator(a2)) + if (!iseffector(a2) && !islocator(a2)) { a2->spr.pos += vect; @@ -1171,7 +1171,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) DukeSectIterator it(Owner->sector()); while (auto a2 = it.Next()) { - if (a2->spr.statnum == STAT_ACTOR && badguy(a2) && a2->spr.picnum != SECTOREFFECTOR && !islocator(a2)) + if (a2->spr.statnum == STAT_ACTOR && badguy(a2) && !iseffector(a2) && !islocator(a2)) { // if(a2->spr.sector != actor->spr.sector) { @@ -1247,7 +1247,7 @@ void handle_se02(DDukeActor* actor) DukeSectIterator it(actor->sector()); while (auto a2 = it.Next()) { - if (a2->spr.picnum != SECTOREFFECTOR) + if (!iseffector(a2)) { a2->spr.pos += vect; SetActor(a2, a2->spr.pos); diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 3023cc28f..acb3aa1b3 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -179,14 +179,14 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, STAT_MISC); break; - case FEMMAG1: - case FEMMAG2: + case FEMMAG1: // ok + case FEMMAG2: // ok act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; ChangeActorStat(act, 0); break; - case DUKETAG: - case SIGN1: - case SIGN2: + case DUKETAG: // ok + case SIGN1: // ok + case SIGN2: // ok if (ud.multimode < 2 && act->spr.pal) { act->spr.scale = DVector2(0, 0); @@ -194,7 +194,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* } else act->spr.pal = 0; break; - case MASKWALL1: + case MASKWALL1: // all ok case MASKWALL2: case MASKWALL3: case MASKWALL4: @@ -215,7 +215,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 0); break; } - case FOOTPRINTS: + case FOOTPRINTS: // ok case FOOTPRINTS2: case FOOTPRINTS3: case FOOTPRINTS4: @@ -264,13 +264,13 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == MIKE) act->spr.yint = act->spr.hitag; [[fallthrough]]; - case WEATHERWARN: + case WEATHERWARN: // ok ChangeActorStat(act, STAT_ACTOR); break; - case SPOTLITE: + case SPOTLITE: // ok break; - case BULLETHOLE: + case BULLETHOLE: // ok act->spr.scale = DVector2(0.046875, 0.046875); act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip(); insertspriteq(act); @@ -371,7 +371,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, STAT_MISC); break; - case WATERDRIPSPLASH: + case WATERDRIPSPLASH: // ok act->spr.scale = DVector2(0.375, 0.375); ChangeActorStat(act, STAT_STANDABLE); break; @@ -594,14 +594,14 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, STAT_STANDABLE); break; - case CAMERAPOLE: + case CAMERAPOLE: // ok act->spr.extra = 1; if (gs.camerashitable) act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; else act->spr.cstat = 0; [[fallthrough]]; - case GENERICPOLE: + case GENERICPOLE: // ok if (ud.multimode < 2 && act->spr.pal != 0) {