diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index dc3152541..9bf0e5586 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4511,7 +4511,7 @@ static Collision MoveThing(DBloodActor* actor) actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; if ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode()) enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy - ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), actor->int_clipdist(), (actor->spr.pos.Z - top) * 0.25, (bottom - actor->spr.pos.Z) * 0.25, CLIPMASK0, lhit); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), actor->fClipdist(), (actor->spr.pos.Z - top) * 0.25, (bottom - actor->spr.pos.Z) * 0.25, CLIPMASK0, lhit); actor->hit.hit = lhit; enginecompatibility_mode = bakCompat; // restore actor->spr.cstat = bakCstat; @@ -4725,7 +4725,7 @@ void MoveDude(DBloodActor* actor) auto bakCstat = actor->spr.cstat; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; // Note: vel is Q16.16, ClipMove wants Q28.4, which passes it on to clipmove which wants Q14.18. Anyone confused yet...? - ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), int(wdf * worldtoint), tz, bz, CLIPMASK0, actor->hit.hit); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), wdf, tz, bz, CLIPMASK0, actor->hit.hit); if (pSector == nullptr) { pSector = actor->sector(); @@ -5224,7 +5224,7 @@ int MoveMissile(DBloodActor* actor) actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; // remove self collisions for accurate clipmove } Collision clipmoveresult; - ClipMove(ppos, &pSector2, vel.XY(), actor->int_clipdist(), (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1); + ClipMove(ppos, &pSector2, vel.XY(), actor->fClipdist(), (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1); enginecompatibility_mode = bakCompat; // restore actor->spr.cstat = bakSpriteCstat; auto pSector = pSector2; diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 4e3b61c87..d5ca70aae 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -510,7 +510,7 @@ void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Col // //--------------------------------------------------------------------------- -void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount) +void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount) { auto opos = pos; sectortype* bakSect = *pSector; @@ -521,7 +521,7 @@ void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, vel.X = (FloatToFixed(vect.X) >> 12) / 16.; vel.Y = (FloatToFixed(vect.Y) >> 12) / 16.; - clipmove(pos, &bakSect, vel, wd * inttoworld, cd, fd, nMask, hit, tracecount); + clipmove(pos, &bakSect, vel, wd, cd, fd, nMask, hit, tracecount); if (bakSect == nullptr) { pos = opos; diff --git a/source/games/blood/src/gameutil.h b/source/games/blood/src/gameutil.h index 433e28530..e02ff5e96 100644 --- a/source/games/blood/src/gameutil.h +++ b/source/games/blood/src/gameutil.h @@ -39,7 +39,7 @@ int VectorScan(DBloodActor* pSprite, double nOffset, double nZOffset, const DVec void GetZRange(DBloodActor* pSprite, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0); void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0); -void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3); +void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3); BitArray GetClosestSpriteSectors(sectortype* pSector, const DVector2& pos, int nDist, TArray* pWalls, bool newSectCheckMethod = false); int picWidth(int nPic, int repeat); int picHeight(int nPic, int repeat); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 9e39f5e3c..940e4f7f7 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1661,7 +1661,7 @@ void debrisMove(int listIndex) auto oldcstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); - ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), int(clipDistf * worldtoint), ceilDist, floorDist, CLIPMASK0, moveHit); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), clipDistf, ceilDist, floorDist, CLIPMASK0, moveHit); actor->hit.hit = moveHit; actor->spr.cstat = oldcstat;