diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index a033bf299..8dea47ab3 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2546,11 +2546,11 @@ void gutsdir(DDukeActor* actor, int gtype, int n, int p) sx = sy = 8; else sx = sy = 32; - int gutz = actor->int_pos().Z - (8 << 8); - int floorz = getflorzofslopeptr(actor->sector(), actor->spr.pos); + double gutz = actor->spr.pos.Z - 8; + double floorz = getflorzofslopeptrf(actor->sector(), actor->spr.pos); - if (gutz > (floorz - (8 << 8))) - gutz = floorz - (8 << 8); + if (gutz > floorz - 8) + gutz = floorz - 8; gutz += gs.actorinfo[actor->spr.picnum].gutsoffset; @@ -2560,7 +2560,7 @@ void gutsdir(DDukeActor* actor, int gtype, int n, int p) int r1 = krand(); int r2 = krand(); // TRANSITIONAL: owned by a player??? - EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, gutz, gtype, -32, sx, sy, a, 256 + (r2 & 127), -512 - (r1 & 2047), ps[p].GetActor(), 5); + CreateActor(actor->sector(), DVector3(actor->spr.pos.XY(), gutz), gtype, -32, sx, sy, a, 256 + (r2 & 127), -512 - (r1 & 2047), ps[p].GetActor(), 5); } } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 831edc032..ced0e3fc6 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -551,7 +551,7 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p) if (gutz > (floorz - (8 << 8))) gutz = floorz - (8 << 8); - gutz += gs.actorinfo[actor->spr.picnum].gutsoffset; + gutz += gs.actorinfo[actor->spr.picnum].gutsoffset * 256; if (badguy(actor) && actor->spr.pal == 6) pal = 6; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index e5bc708fc..f96e83276 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -458,7 +458,7 @@ void guts_r(DDukeActor* actor, int gtype, int n, int p) if (gutz > (floorz - (8 << 8))) gutz = floorz - (8 << 8); - gutz += gs.actorinfo[actor->spr.picnum].gutsoffset; + gutz += gs.actorinfo[actor->spr.picnum].gutsoffset * 256; if (badguy(actor) && actor->spr.pal == 6) pal = 6; diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index caf5d2a0b..341d2ee99 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -148,7 +148,7 @@ void initactorflags_d() settileflag(TFLAG_CLEARINVENTORY, { HURTRAIL, FLOORSLIME, FLOORPLASMA }); settileflag(TFLAG_SLIME, { FLOORSLIME, FLOORSLIME + 1, FLOORSLIME + 2 }); - gs.actorinfo[COMMANDER].gutsoffset = -(24 << 8); + gs.actorinfo[COMMANDER].gutsoffset = -24; for (auto &fa : gs.actorinfo) {