From 03a0eb728449a688cf1d914a4324f890ba0ec6e7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Sep 2022 23:51:48 +0200 Subject: [PATCH] - floatified and consolidated handle_se29. --- source/games/duke/src/actors.cpp | 14 ++++++++++++++ source/games/duke/src/actors_d.cpp | 7 ++----- source/games/duke/src/actors_r.cpp | 6 +----- source/games/duke/src/funct.h | 1 + 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index bbbb3c358..caa9aced5 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4617,6 +4617,20 @@ void handle_se130(DDukeActor *actor, int countmax, int EXPLOSION2) // //--------------------------------------------------------------------------- +void handle_se29(DDukeActor* actor) +{ + auto sc = actor->sector(); + actor->spr.hitag += 64; + double val = actor->spr.yint * BobVal(actor->spr.hitag) / 64.; + sc->setfloorz(actor->spr.pos.Z + val); +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + void handle_se31(DDukeActor* actor, bool choosedir) { auto sec = actor->sector(); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index d455421fd..67ab2a4d3 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3292,8 +3292,6 @@ static void handle_se28(DDukeActor* actor) void moveeffectors_d(void) //STATNUM 3 { - int l; - clearfriction(); DukeStatIterator it(STAT_EFFECTOR); @@ -3423,10 +3421,9 @@ void moveeffectors_d(void) //STATNUM 3 break; case SE_29_WAVES: - act->spr.hitag += 64; - l = MulScale(act->spr.yint, bsin(act->spr.hitag), 12); - sc->set_int_floorz(act->int_pos().Z + l); + handle_se29(act); break; + case SE_31_FLOOR_RISE_FALL: // True Drop Floor handle_se31(act, true); break; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 19f4110b1..a1e0b01ba 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -3243,8 +3243,6 @@ void handle_se06_r(DDukeActor *actor) void moveeffectors_r(void) //STATNUM 3 { - int l; - clearfriction(); DukeStatIterator it(STAT_EFFECTOR); @@ -3384,9 +3382,7 @@ void moveeffectors_r(void) //STATNUM 3 break; case SE_29_WAVES: - act->spr.hitag += 64; - l = MulScale(act->spr.yint, bsin(act->spr.hitag), 12); - sc->set_int_floorz(act->int_pos().Z + l); + handle_se29(act); break; case SE_31_FLOOR_RISE_FALL: // True Drop Floor diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index aa2c6d4de..962003ce0 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -89,6 +89,7 @@ void handle_se24(DDukeActor* actor, bool scroll, int shift); void handle_se25(DDukeActor* a, int t_index, int snd1, int snd2); void handle_se26(DDukeActor* i); void handle_se27(DDukeActor* i); +void handle_se29(DDukeActor* actor); void handle_se31(DDukeActor* a, bool choosedir); void handle_se32(DDukeActor* i); void handle_se35(DDukeActor* i, int SMALLSMOKE, int EXPLOSION2);