From 81d4ca71d7319296b20771349d3435dfd7e2c96c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Sep 2022 23:16:06 +0200 Subject: [PATCH] - floatified movetouchplate --- source/games/duke/src/actors.cpp | 20 ++++++++++---------- source/games/duke/src/spawn_d.cpp | 6 +++--- source/games/duke/src/spawn_r.cpp | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 170448702..2d932613a 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1075,40 +1075,40 @@ void movedoorshock(DDukeActor* actor) void movetouchplate(DDukeActor* actor, int plate) { auto sectp = actor->sector(); - int x; int p; if (actor->temp_data[1] == 1 && actor->spr.hitag >= 0) //Move the sector floor { - x = sectp->int_floorz(); + double X = sectp->floorz; + double add = sectp->extra * zmaptoworld; if (actor->temp_data[3] == 1) { - if (x >= actor->temp_data[2]) + if (X >= actor->temp_pos.Z) { - sectp->set_int_floorz(x); + sectp->setfloorz(X); actor->temp_data[1] = 0; } else { - sectp->add_int_floorz(sectp->extra); + sectp->addfloorz(add); p = checkcursectnums(actor->sector()); - if (p >= 0) ps[p].pos.Z += sectp->extra * zmaptoworld; + if (p >= 0) ps[p].pos.Z += add; } } else { - if (x <= actor->int_pos().Z) + if (X <= actor->spr.pos.Z) { sectp->setfloorz(actor->spr.pos.Z); actor->temp_data[1] = 0; } else { - sectp->floorz -= sectp->extra * zmaptoworld; + sectp->floorz -= add; p = checkcursectnums(actor->sector()); if (p >= 0) - ps[p].pos.Z -= sectp->extra * zmaptoworld; + ps[p].pos.Z -= add; } } return; @@ -1117,7 +1117,7 @@ void movetouchplate(DDukeActor* actor, int plate) if (actor->temp_data[5] == 1) return; p = checkcursectnums(actor->sector()); - if (p >= 0 && (ps[p].on_ground || actor->spr.angle == DAngle90)) + if (p >= 0 && (ps[p].on_ground || actor->spr.intangle == 512)) { if (actor->temp_data[0] == 0 && !check_activator_motion(actor->spr.lotag)) { diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 793db8f94..6e6484ca3 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -717,7 +717,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 6); break; case TOUCHPLATE: - act->temp_data[2] = sectp->int_floorz(); + act->temp_pos.Z = sectp->floorz; if (sectp->lotag != 1 && sectp->lotag != 2) sectp->setfloorz(act->spr.pos.Z); if (!isWorldTour()) @@ -743,11 +743,11 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case WATERBUBBLEMAKER: if (act->spr.hitag && act->spr.picnum == WATERBUBBLEMAKER) { // JBF 20030913: Pisses off move(), eg. in bobsp2 - Printf(TEXTCOLOR_YELLOW "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n", act->GetIndex(), act->int_pos().X, act->int_pos().Y); + Printf(TEXTCOLOR_YELLOW "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n", act->GetIndex(), int(act->spr.pos.X), int(act->spr.pos.Y)); act->spr.hitag = 0; } act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - ChangeActorStat(act, 6); + ChangeActorStat(act, STAT_STANDABLE); break; case BOLT1: case BOLT1 + 1: diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 2587fe30e..1aa2e609c 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -715,7 +715,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 6); break; case TOUCHPLATE: - act->temp_data[2] = sectp->int_floorz(); + act->temp_pos.Z = sectp->floorz; if (sectp->lotag != 1 && sectp->lotag != 2) sectp->setfloorz(act->spr.pos.Z); if (act->spr.pal && ud.multimode > 1) @@ -727,7 +727,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* [[fallthrough]]; case WATERBUBBLEMAKER: act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - ChangeActorStat(act, 6); + ChangeActorStat(act, STAT_STANDABLE); break; case BOLT1: case BOLT1 + 1: