From 22ccf33569a86bde47f4bae1eaddd21082619719 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Sep 2022 19:52:01 +0200 Subject: [PATCH] - floatified walldist parameter of getzrange --- source/build/include/build.h | 5 +++++ source/games/blood/src/actor.cpp | 20 ++++++++++---------- source/games/blood/src/callback.cpp | 6 +++--- source/games/blood/src/gameutil.cpp | 4 ++-- source/games/blood/src/gameutil.h | 4 ++-- source/games/blood/src/nnexts.cpp | 10 +++++----- source/games/duke/src/actors.cpp | 8 ++++---- source/games/duke/src/player_d.cpp | 2 +- source/games/duke/src/player_r.cpp | 4 ++-- source/games/exhumed/src/move.cpp | 2 +- source/games/sw/src/game.h | 6 ++++-- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/rooms.cpp | 2 +- source/games/sw/src/sprite.cpp | 4 ++-- source/games/sw/src/weapon.cpp | 2 +- 15 files changed, 44 insertions(+), 37 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index bfb83107f..923517cfb 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -112,6 +112,11 @@ class F2DDrawer; void getzrange(const DVector3& pos, sectortype* sect, double* ceilz, CollisionBase& ceilhit, double* florz, CollisionBase& florhit, int32_t walldist, uint32_t cliptype); +inline +void getzrange(const DVector3& pos, sectortype* sect, double* ceilz, CollisionBase& ceilhit, double* florz, CollisionBase& florhit, double walldist, uint32_t cliptype) +{ + getzrange(pos, sect, ceilz, ceilhit, florz, florhit, int(walldist * worldtoint), cliptype); +} struct HitInfoBase; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index ec8cb5105..aa9c59021 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4551,7 +4551,7 @@ static Collision MoveThing(DBloodActor* actor) double ceilZ, floorZ; Collision ceilColl, floorColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist(), CLIPMASK0); GetActorExtents(actor, &top, &bottom); if ((actor->spr.flags & 2) && bottom < floorZ) @@ -4570,7 +4570,7 @@ static Collision MoveThing(DBloodActor* actor) } } } - if (CheckLink(actor)) GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0); + if (CheckLink(actor)) GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist(), CLIPMASK0); GetActorExtents(actor, &top, &bottom); if (bottom >= floorZ) @@ -4706,7 +4706,7 @@ void MoveDude(DBloodActor* actor) GetActorExtents(actor, &top, &bottom); double bz = (bottom - actor->spr.pos.Z) / 4; double tz = (actor->spr.pos.Z - top) / 4; - int wd = actor->int_clipdist(); + double wdf = actor->fClipdist(); auto pSector = actor->sector(); int nAiStateType = (actor->xspr.aiState) ? actor->xspr.aiState->stateType : -1; @@ -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(), wd, tz, bz, CLIPMASK0, actor->hit.hit); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), int(wdf * worldtoint), tz, bz, CLIPMASK0, actor->hit.hit); if (pSector == nullptr) { pSector = actor->sector(); @@ -4736,7 +4736,7 @@ void MoveDude(DBloodActor* actor) if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate) { auto pSector2 = pSector; - if (pushmove(actor, &pSector2, wd, tz, bz, CLIPMASK0) == -1) + if (pushmove(actor, &pSector2, int(wdf * worldtoint), tz, bz, CLIPMASK0) == -1) actDamageSprite(actor, actor, kDamageFall, 1000 << 4); if (pSector2 != nullptr) pSector = pSector2; @@ -4834,12 +4834,12 @@ void MoveDude(DBloodActor* actor) DCoreActor* pLowerLink = pSector->lowerLink; if (pUpperLink && (pUpperLink->spr.type == kMarkerUpWater || pUpperLink->spr.type == kMarkerUpGoo)) bDepth = 1; if (pLowerLink && (pLowerLink->spr.type == kMarkerLowWater || pLowerLink->spr.type == kMarkerLowGoo)) bDepth = 1; - if (pPlayer) wd += 16; + if (pPlayer) wdf += 1; if (actor->vel.Z) actor->spr.pos.Z += actor->vel.Z; double ceilZ, floorZ; Collision ceilColl, floorColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, wd, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, wdf, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); GetActorExtents(actor, &top, &bottom); if (actor->spr.flags & 2) @@ -4888,7 +4888,7 @@ void MoveDude(DBloodActor* actor) int nLink = CheckLink(actor); if (nLink) { - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, wd, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, wdf, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); if (pPlayer) playerCorrectInertia(pPlayer, oldpos); switch (nLink) @@ -5052,7 +5052,7 @@ void MoveDude(DBloodActor* actor) { double floorZ2 = floorZ; auto floorColl2 = floorColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist(), CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); if (bottom <= floorZ && actor->spr.pos.Z - floorZ2 < bz) { floorZ = floorZ2; @@ -5280,7 +5280,7 @@ int MoveMissile(DBloodActor* actor) } double ceilZ, floorZ; Collision ceilColl, floorColl; - GetZRangeAtXYZ(ppos, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0); + GetZRangeAtXYZ(ppos, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist(), CLIPMASK0); GetActorExtents(actor, &top, &bottom); top += vel.Z; bottom += vel.Z; diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 345ad9b24..d721acdd9 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -439,7 +439,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14 if (!actor) return; double ceilZ, floorZ; Collision floorColl, ceilColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->native_clipdist(), CLIPMASK0); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist() * 0.25, CLIPMASK0); double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z += floorZ - bottom; @@ -497,7 +497,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16 double ceilZ, floorZ; Collision floorColl, ceilColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->native_clipdist(), CLIPMASK0); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist() * 0.25, CLIPMASK0); double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z += floorZ - bottom; @@ -629,7 +629,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 double ceilZ, floorZ; Collision floorColl, ceilColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->native_clipdist(), CLIPMASK0); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->fClipdist() * 0.25, CLIPMASK0); double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z += floorZ - bottom; diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 0e0d9faba..88b272819 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -413,7 +413,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto // //--------------------------------------------------------------------------- -void GetZRange(DBloodActor* actor, double* ceilZ, Collision* ceilColl, double* floorZ, Collision* floorColl, int nDist, unsigned int nMask, unsigned int nClipParallax) +void GetZRange(DBloodActor* actor, double* ceilZ, Collision* ceilColl, double* floorZ, Collision* floorColl, double nDist, unsigned int nMask, unsigned int nClipParallax) { assert(actor != nullptr); Collision scratch; @@ -464,7 +464,7 @@ void GetZRange(DBloodActor* actor, double* ceilZ, Collision* ceilColl, double* f // //--------------------------------------------------------------------------- -void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilColl, double* floorZ, Collision* floorColl, int nDist, unsigned int nMask, unsigned int nClipParallax) +void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilColl, double* floorZ, Collision* floorColl, double nDist, unsigned int nMask, unsigned int nClipParallax) { Collision scratch; double nTemp1; diff --git a/source/games/blood/src/gameutil.h b/source/games/blood/src/gameutil.h index 7a33eb94b..5659e8ede 100644 --- a/source/games/blood/src/gameutil.h +++ b/source/games/blood/src/gameutil.h @@ -36,8 +36,8 @@ bool CheckProximity(DBloodActor* pSprite, const DVector3& pos, sectortype* pSect int HitScan(DBloodActor* pSprite, double z, const DVector3& pos, unsigned int nMask, double range = 0); int VectorScan(DBloodActor* pSprite, double nOffset, double nZOffset, const DVector3& vel, double nRange, int ac); -void GetZRange(DBloodActor* pSprite, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0); -void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0); +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); [[deprecated]] // take care of this together with the engines clipmove. void ClipMove(vec3_t& pos, sectortype** pSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 5cda6e676..cb30109bd 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1645,7 +1645,7 @@ void debrisMove(int listIndex) moveHit.setNone(); double floorDist = (bottom - actor->spr.pos.Z) * 0.25; double ceilDist = (actor->spr.pos.Z - top) * 0.25; - int clipDist = actor->int_clipdist(); + double clipDistf = actor->fClipdist(); int mass = actor->spriteMass.mass; bool uwater = false; @@ -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(), clipDist, ceilDist, floorDist, CLIPMASK0, moveHit); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), int(clipDistf * worldtoint), ceilDist, floorDist, CLIPMASK0, moveHit); actor->hit.hit = moveHit; actor->spr.cstat = oldcstat; @@ -1674,7 +1674,7 @@ void debrisMove(int listIndex) if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate) { auto pSector2 = pSector; - if (pushmove(actor, &pSector2, clipDist, ceilDist, floorDist, CLIPMASK0) != -1) + if (pushmove(actor, &pSector2, int(clipDistf * worldtoint), ceilDist, floorDist, CLIPMASK0) != -1) pSector = pSector2; } @@ -1705,7 +1705,7 @@ void debrisMove(int listIndex) double ceilZ, floorZ; Collision ceilColl, floorColl; - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, clipDist, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, clipDistf, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); GetActorExtents(actor, &top, &bottom); if ((actor->xspr.physAttr & kPhysDebrisSwim) && uwater) @@ -1738,7 +1738,7 @@ void debrisMove(int listIndex) int i; if ((i = CheckLink(actor)) != 0) { - GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, clipDist, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); + GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, clipDistf, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR); if (!(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) { switch (i) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index f286f5dc5..3507685b8 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4777,14 +4777,14 @@ void handle_se31(DDukeActor* actor, bool choosedir) void getglobalz(DDukeActor* actor) { - int zr; + double zr; Collision hz, lz; if( actor->spr.statnum == STAT_PLAYER || actor->spr.statnum == STAT_STANDABLE || actor->spr.statnum == STAT_ZOMBIEACTOR || actor->spr.statnum == STAT_ACTOR || actor->spr.statnum == STAT_PROJECTILE) { if(actor->spr.statnum == STAT_PROJECTILE) - zr = 4; - else zr = 127; + zr = 0.25; + else zr = 7.9375; auto cc = actor->spr.cstat2; actor->spr.cstat2 |= CSTAT2_SPRITE_NOFIND; // don't clip against self. getzrange cannot detect this because it only receives a coordinate. @@ -4850,7 +4850,7 @@ void makeitfall(DDukeActor* actor) if ((actor->spr.statnum == STAT_ACTOR || actor->spr.statnum == STAT_PLAYER || actor->spr.statnum == STAT_ZOMBIEACTOR || actor->spr.statnum == STAT_STANDABLE)) { Collision coll; - getzrange(actor->spr.pos.plusZ(-1), actor->sector(), &actor->ceilingz, coll, &actor->floorz, coll, 127, CLIPMASK0); + getzrange(actor->spr.pos.plusZ(-1), actor->sector(), &actor->ceilingz, coll, &actor->floorz, coll, 7.9375, CLIPMASK0); } else { diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index b30b8786f..2a68d1d8f 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2778,7 +2778,7 @@ void processinput_d(int snum) p->spritebridge = 0; shrunk = (pact->spr.yrepeat < 32); - getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 163, CLIPMASK0); + getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 10.1875, CLIPMASK0); p->truefz = getflorzofslopeptr(psectp, p->pos); p->truecz = getceilzofslopeptr(psectp, p->pos); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 0c92dbf4b..54025d2c5 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3397,12 +3397,12 @@ void processinput_r(int snum) double tempfz; if (pact->native_clipdist() == 64) { - getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 163L, CLIPMASK0); + getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 10.1875, CLIPMASK0); tempfz = getflorzofslopeptr(psectp, p->pos); } else { - getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 4L, CLIPMASK0); + getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 0.25, CLIPMASK0); tempfz = getflorzofslopeptr(psectp, p->pos); } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index e26f2db1d..518505d65 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -291,7 +291,7 @@ Collision movespritez(DExhumedActor* pActor, double z, double height, double cli double sprceiling, sprfloor; auto pos = pActor->spr.pos.plusZ(-1); - getzrange(pos, pActor->sector(), &sprceiling, hiHit, &sprfloor, loHit, 128, CLIPMASK0); + getzrange(pos, pActor->sector(), &sprceiling, hiHit, &sprfloor, loHit, 8., CLIPMASK0); double mySprfloor = sprfloor; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 05b55e84e..063521c6d 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1677,7 +1677,7 @@ inline bool FAF_ConnectArea(sectortype* sect) void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, HitInfo& hit, int32_t clipmask); bool FAFcansee(const DVector3& start, sectortype* sects, const DVector3& end, sectortype* secte); -void FAFgetzrange(const DVector3& pos, sectortype* sect, double* hiz, Collision* ceilhit, double* loz, Collision* florhit, int32_t clipdist, int32_t clipmask); +void FAFgetzrange(const DVector3& pos, sectortype* sect, double* hiz, Collision* ceilhit, double* loz, Collision* florhit, double clipdist, int32_t clipmask); void FAFgetzrangepoint(const DVector3& pos, sectortype* sect, double* hiz, Collision* ceilhit, double* loz, Collision* florhit); @@ -1716,7 +1716,6 @@ enum TICSPERMOVEMENT = synctics, ACTOR_GRAVITY = 8, // subtract value from clipdist on getzrange calls - GETZRANGE_CLIP_ADJ = 8, STAT_DAMAGE_LIST_SIZE = 20, COLOR_PAIN = 128, // Light red range @@ -1726,6 +1725,9 @@ enum }; +constexpr double GETZRANGE_CLIP_ADJ = 0.5; + + extern int *lastpacket2clock; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 77d8570ee..8b0d74c23 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1945,7 +1945,7 @@ void DoPlayerZrange(PLAYER* pp) auto bakcstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); - FAFgetzrange(pp->pos.plusZ(8), pp->cursector, &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)actor->int_clipdist()) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); + FAFgetzrange(pp->pos.plusZ(8), pp->cursector, &pp->hiz, &ceilhit, &pp->loz, &florhit, actor->fClipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); actor->spr.cstat = bakcstat; Collision ceilColl(ceilhit); diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index fff4b4808..1aeccb7d1 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -498,7 +498,7 @@ void WaterAdjust(const Collision& florhit, double* loz) // //--------------------------------------------------------------------------- -void FAFgetzrange(const DVector3& pos, sectortype* sect, double* hiz, Collision* ceilhit, double* loz, Collision* florhit, int32_t clipdist, int32_t clipmask) +void FAFgetzrange(const DVector3& pos, sectortype* sect, double* hiz, Collision* ceilhit, double* loz, Collision* florhit, double clipdist, int32_t clipmask) { double foo1; Collision foo2; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 0181d81e6..56ebf597f 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -4488,7 +4488,7 @@ void DoActorZrange(DSWActor* actor) actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); DVector3 pos = actor->spr.pos.plusZ(-ActorSizeZ(actor) * 0.5); - FAFgetzrange(pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->int_clipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR); + FAFgetzrange(pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->fClipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR); actor->spr.cstat |= save_cstat; actor->user.lo_sectp = actor->user.hi_sectp = nullptr; @@ -6391,7 +6391,7 @@ Collision move_sprite(DSWActor* actor, const DVector3& change, double ceildist, auto pos = actor->spr.pos.plusZ(-zH - maptoworld); FAFgetzrange(pos, actor->sector(), &globhiz, &globhihit, &globloz, &globlohit, - actor->int_clipdist() - GETZRANGE_CLIP_ADJ, cliptype); + actor->fClipdist() - GETZRANGE_CLIP_ADJ, cliptype); actor->spr.cstat = tempstat; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index d50f9a367..35e634897 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -11050,7 +11050,7 @@ int DoFindGround(DSWActor* actor) auto save_cstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); - FAFgetzrange(actor->spr.pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->int_clipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); + FAFgetzrange(actor->spr.pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->fClipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); actor->spr.cstat = save_cstat; switch (florhit.type)