From 40312d64c85e644572c66eb08cdf8aff455a32d4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 23 Aug 2022 22:52:22 +0200 Subject: [PATCH] -coordinates --- source/core/gamefuncs.h | 4 ++++ source/games/blood/src/callback.cpp | 4 ++-- source/games/blood/src/nnexts.cpp | 4 ++-- source/games/duke/src/spawn.cpp | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 59f96efed..3ff62b02c 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -319,6 +319,10 @@ inline double getflorzofslopeptrf(const sectortype* sec, double dax, double day) { return getflorzofslopeptr(sec, dax * worldtoint, day * worldtoint) * zinttoworld; } +inline double getceilzofslopeptrf(const sectortype* sec, const DVector2& pos) +{ + return getceilzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint) * zinttoworld; +} inline double getflorzofslopeptrf(const sectortype* sec, const DVector2& pos) { return getflorzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint) * zinttoworld; diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index e502f38ca..40b5a8d57 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -706,9 +706,9 @@ void LeechStateTimer(DBloodActor* actor, sectortype*) // 20 void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ??? { - int top, bottom; + double top, bottom; GetActorExtents(actor, &top, &bottom); - actor->set_int_pos({ actor2->int_pos().X, actor2->int_pos().Y, actor2->sector()->int_floorz() - (bottom - actor->int_pos().Z) }); + actor->spr.pos = actor2->spr.pos.plusZ(-(bottom - actor->spr.pos.Z)); actor->spr.angle = actor2->spr.angle; ChangeActorSect(actor, actor2->sector()); sfxPlay3DSound(actor2, 201, -1, 0); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 321f18f33..b35ec847a 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3796,8 +3796,8 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector case 6: if (!iactor->insector()) pos.Z = top; else pos.Z = ((sourceactor->xspr.data3 == 5) ? - getflorzofslopeptr(spawned->sector(), spawned->int_pos().X, spawned->int_pos().Y) : - getceilzofslopeptr(spawned->sector(), spawned->int_pos().X, spawned->int_pos().Y)); + getflorzofslopeptrf(spawned->sector(), spawned->spr.pos) : + getceilzofslopeptrf(spawned->sector(), spawned->spr.pos)); break; } diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 8d32cd323..b3148a22d 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -959,7 +959,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) tempwallptr++; if (tempwallptr > 2047) { - I_Error("Too many moving sectors at (%d,%d).\n", wal.wall_int_pos().X, wal.wall_int_pos().Y); + I_Error("Too many moving sectors at (%d,%d).\n", int(wal.pos.X), int(wal.pos.Y)); } } if (actor->spr.lotag == SE_30_TWO_WAY_TRAIN || actor->spr.lotag == SE_6_SUBWAY || actor->spr.lotag == SE_14_SUBWAY_CAR || actor->spr.lotag == SE_5_BOSS) @@ -985,7 +985,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) if (s == nullptr) { - I_Error("Subway found no zero'd sectors with locators\nat (%d,%d).\n", actor->int_pos().X, actor->int_pos().Y); + I_Error("Subway found no zero'd sectors with locators\nat (%d,%d).\n", int(actor->spr.pos.X), int(actor->spr.pos.Y)); } actor->SetOwner(nullptr);