From daf71fa470be0db91fc72f856a74ab1acad435bf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 Nov 2020 20:06:38 +0100 Subject: [PATCH] - replaced a few more literal numbers. --- source/games/duke/src/actors_d.cpp | 22 +++++++++++----------- source/games/duke/src/actors_r.cpp | 24 ++++++++++++------------ source/games/duke/src/spawn.cpp | 15 ++++++++++----- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index dc6f06d96..2453fe3fd 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3719,51 +3719,51 @@ void moveeffectors_d(void) //STATNUM 3 break; case SE_24_CONVEYOR: - case 34: + case SE_34: { static int16_t list1[] = { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, FOOTPRINTS4, BULLETHOLE, BLOODSPLAT1, BLOODSPLAT2, BLOODSPLAT3, BLOODSPLAT4, -1 }; static int16_t list2[] = { BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, SIDEBOLT1, SIDEBOLT1 + 1, SIDEBOLT1 + 2, SIDEBOLT1 + 3, -1 }; handle_se24(act, list1, list2, TRIPBOMB, LASERLINE, CRANE, 2); break; } - case 35: + case SE_35: handle_se35(act, SMALLSMOKE, EXPLOSION2); break; - case 25: //PISTONS + case SE_25_PISTON: //PISTONS if (act->temp_data[4] == 0) break; handle_se25(act, 3, -1, -1); break; - case 26: + case SE_26: handle_se26(act); break; case SE_27_DEMO_CAM: handle_se27(act); break; - case 28: + case SE_28_LIGHTNING: handle_se28(act); break; - case 29: + case SE_29_WAVES: act->s.hitag += 64; l = mulscale12(act->s.yvel, bsin(act->s.hitag)); sc->floorz = act->s.z + l; break; - case 31: // True Drop Floor + case SE_31_FLOOR_RISE_FALL: // True Drop Floor handle_se31(act, true); break; - case 32: // True Drop Ceiling + case SE_32_CEILING_RISE_FALL: // True Drop Ceiling handle_se32(act); break; - case 33: + case SE_33_QUAKE_DEBRIS: if (earthquaketime > 0 && (krand() & 7) == 0) RANDOMSCRAP(act); break; - case 36: + case SE_36_PROJ_SHOOTER: if (act->temp_data[0]) { @@ -3792,7 +3792,7 @@ void moveeffectors_d(void) //STATNUM 3 it.Reset(STAT_EFFECTOR); while (auto act = it.Next()) { - if (act->s.lotag != 29) continue; + if (act->s.lotag != SE_29_WAVES) continue; auto sc = §or[act->s.sectnum]; if (sc->wallnum != 4) continue; auto wal = &wall[sc->wallptr + 2]; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 5a34fd7f8..fe893bc0f 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -3602,7 +3602,7 @@ void moveeffectors_r(void) //STATNUM 3 case 156: if (!isRRRA()) break; case SE_24_CONVEYOR: - case 34: + case SE_34: { static int16_t list1[] = { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, -1 }; static int16_t list2[] = { BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, -1 }; @@ -3610,16 +3610,16 @@ void moveeffectors_r(void) //STATNUM 3 break; } - case 35: + case SE_35: handle_se35(act, SMALLSMOKE, EXPLOSION2); break; - case 25: //PISTONS + case SE_25_PISTON: //PISTONS if (t[4] == 0) break; handle_se25(act, 4, isRRRA() ? 371 : -1, isRRRA() ? 167 : -1); break; - case 26: + case SE_26: handle_se26(act); break; @@ -3627,25 +3627,25 @@ void moveeffectors_r(void) //STATNUM 3 handle_se27(act); break; - case 29: + case SE_29_WAVES: act->s.hitag += 64; l = mulscale12(act->s.yvel, bsin(act->s.hitag)); sc->floorz = act->s.z + l; break; - case 31: // True Drop Floor + case SE_31_FLOOR_RISE_FALL: // True Drop Floor handle_se31(act, false); break; - case 32: // True Drop Ceiling + case SE_32_CEILING_RISE_FALL: // True Drop Ceiling handle_se32(act); break; - case 33: + case SE_33_QUAKE_DEBRIS: if (earthquaketime > 0 && (krand() & 7) == 0) RANDOMSCRAP(act); break; - case 36: + case SE_36_PROJ_SHOOTER: if (t[0]) { @@ -3661,10 +3661,10 @@ void moveeffectors_r(void) //STATNUM 3 handle_se128(act); break; - case 130: + case SE_130: handle_se130(act, 80, EXPLOSION2); break; - case 131: + case SE_131: handle_se130(act, 40, EXPLOSION2); break; } @@ -3675,7 +3675,7 @@ void moveeffectors_r(void) //STATNUM 3 while (auto act = it.Next()) { auto s = &act->s; - if (act->s.lotag != 29) continue; + if (act->s.lotag != SE_29_WAVES) continue; auto sc = §or[act->s.sectnum]; if (sc->wallnum != 4) continue; auto wal = &wall[sc->wallptr + 2]; diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 1962c01f7..e25a20e68 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -1015,7 +1015,7 @@ void spawneffector(DDukeActor* actor) I_Error("Too many moving sectors at (%d,%d).\n", wall[s].x, wall[s].y); } } - if (sp->lotag == 30 || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5) + if (sp->lotag == SE_30_TWO_WAY_TRAIN || sp->lotag == SE_6_SUBWAY || sp->lotag == SE_14_SUBWAY_CAR || sp->lotag == SE_5_BOSS) { startwall = sector[sect].wallptr; @@ -1049,14 +1049,14 @@ void spawneffector(DDukeActor* actor) actor->SetOwner(nullptr); t[0] = s; - if (sp->lotag != 30) + if (sp->lotag != SE_30_TWO_WAY_TRAIN) t[3] = sp->hitag; } - else if (sp->lotag == 16) + else if (sp->lotag == SE_16_REACTOR) t[3] = sector[sect].ceilingz; - else if (sp->lotag == 26) + else if (sp->lotag == SE_26) { t[3] = sp->x; t[4] = sp->y; @@ -1067,7 +1067,7 @@ void spawneffector(DDukeActor* actor) sp->shade = 0; } - else if (sp->lotag == 2) + else if (sp->lotag == SE_2_EARTHQUAKE) { t[5] = sector[sp->sectnum].floorheinum; sector[sp->sectnum].floorheinum = 0; @@ -1099,6 +1099,11 @@ void spawneffector(DDukeActor* actor) case SE_26: setsectinterpolate(actor->s.sectnum); break; + + case SE_29_WAVES: + //This does not work. Why? + //StartInterpolation(actor->s.sectnum, Interp_Sect_Floorheinum); + break; } if ((!isRR() && actor->s.lotag >= 40 && actor->s.lotag <= 45) ||