diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 2d617ccd6..8c609e49b 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -389,7 +389,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat } if (t->sectp->lotag == 2) k += 1795 - 1405; - else if ((h->actor_int_floorz() - h->int_pos().Z) > (64 << 8)) k += 60; + else if ((h->floorz - h->spr.pos.Z) > 64) k += 60; t->picnum += k; t->pal = ps[p].palookup; @@ -399,9 +399,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1) { - l = h->int_pos().Z - ps[p].GetActor()->actor_int_floorz() + (3 << 8); - if (l > 1024 && h->spr.yrepeat > 32 && h->spr.extra > 0) - h->spr.yoffset = (int8_t)(l / (h->spr.yrepeat << 2)); + double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3; + if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0) + h->spr.yoffset = (int8_t)(v * (1/REPEAT_SCALE) / h->spr.yrepeat); else h->spr.yoffset = 0; } @@ -428,8 +428,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (!h->GetOwner()) continue; - if (t->int_pos().Z > h->actor_int_floorz() && t->xrepeat < 32) - t->set_int_z(h->actor_int_floorz()); + if (t->pos.Z > h->floorz && t->xrepeat < 32) + t->pos.Z = h->floorz; break; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index e9d99608b..37846ec9b 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -435,7 +435,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat } if (t->sectp->lotag == 2) k += 1795 - 1405; - else if ((h->actor_int_floorz() - h->int_pos().Z) > (64 << 8)) k += 60; + else if ((h->floorz - h->spr.pos.Z) > 64) k += 60; t->picnum += k; t->pal = ps[p].palookup; @@ -445,9 +445,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1) { - l = h->int_pos().Z - ps[p].GetActor()->actor_int_floorz() + (3 << 8); - if (l > 1024 && h->spr.yrepeat > 32 && h->spr.extra > 0) - h->spr.yoffset = (int8_t)(l / (h->spr.yrepeat << 2)); + double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3; + if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0) + h->spr.yoffset = (int8_t)(v * (1 / REPEAT_SCALE) / h->spr.yrepeat); else h->spr.yoffset = 0; } @@ -474,8 +474,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (!h->GetOwner()) continue; - if (t->int_pos().Z > h->actor_int_floorz() && t->xrepeat < 32) - t->set_int_z(h->actor_int_floorz()); + if (t->pos.Z > h->floorz && t->xrepeat < 32) + t->pos.Z = h->floorz; if (ps[p].OnMotorcycle && p == screenpeek) { diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index d70018f05..33523aced 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -527,7 +527,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == RESPAWNMARKERRED) { act->spr.xrepeat = act->spr.yrepeat = 24; - if (actj) act->set_int_z(actj->actor_int_floorz()); // -(1<<4); + if (actj) act->spr.pos.Z = actj->floorz; // -(1<<4); } else { @@ -939,7 +939,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* getglobalz(act); - int j = (act->actor_int_floorz() - act->actor_int_ceilingz()) >> 9; + int j = int((act->floorz - act->ceilingz) * 0.5); act->spr.yrepeat = j; act->spr.xrepeat = 25 - (j >> 1); diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 5afe3466c..46b05fe40 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -554,7 +554,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == RESPAWNMARKERRED) { act->spr.xrepeat = act->spr.yrepeat = 8; - if (actj) act->set_int_z(actj->actor_int_floorz()); + if (actj) act->spr.pos.Z = actj->floorz; } else { @@ -1092,7 +1092,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* getglobalz(act); - int j = (act->actor_int_floorz() - act->actor_int_ceilingz()) >> 9; + int j = int((act->floorz - act->ceilingz) * 0.5); act->spr.yrepeat = j; act->spr.xrepeat = 25 - (j >> 1);