diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 4a52caa17..c8fc9af87 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -53,6 +53,11 @@ public: return time; } + DVector3 float_pos() const + { + return { spr.pos.X * inttoworld, spr.pos.Y * inttoworld, spr.pos.Z * zinttoworld }; + } + int32_t interpolatedx(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.X, spr.pos.X, smoothratio, scale); diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index 16cf95a9f..d06c97d44 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -605,15 +605,15 @@ void prelevel_r(int g, TArray& actors) if (actor2->spr.hitag == 1) { geosectorwarp[geocnt] = actor2->sector(); - geox[geocnt] = (actor->spr.pos.X - actor2->spr.pos.X) * inttoworld; - geoy[geocnt] = (actor->spr.pos.Y - actor2->spr.pos.Y) * inttoworld; + geox[geocnt] = actor->float_pos().X - actor2->float_pos().X; + geoy[geocnt] = actor->float_pos().Y - actor2->float_pos().Y; //geoz[geocnt] = actor->spr.z - actor2->spr.z; } if (actor2->spr.hitag == 2) { geosectorwarp2[geocnt] = actor2->sector(); - geox2[geocnt] = (actor->spr.pos.X - actor2->spr.pos.X) * inttoworld; - geoy2[geocnt] = (actor->spr.pos.Y - actor2->spr.pos.Y) * inttoworld; + geox2[geocnt] = actor->float_pos().X - actor2->float_pos().X; + geoy2[geocnt] = actor->float_pos().Y - actor2->float_pos().Y; //geoz2[geocnt] = actor->spr.z - actor2->spr.z; } }