mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- wrap clipdist << 2
This commit is contained in:
parent
7fb7146b7b
commit
3e36b5627b
16 changed files with 47 additions and 42 deletions
|
@ -507,10 +507,10 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
|
||||
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
|
||||
{
|
||||
int32_t bsz = (actor->spr.clipdist << 2)+walldist;
|
||||
int32_t bsz = (actor->int_clipdist())+walldist;
|
||||
if (diff.X < 0) bsz = -bsz;
|
||||
addclipline(p1.X-bsz, p1.Y-bsz, p1.X-bsz, p1.Y+bsz, obj, false);
|
||||
bsz = (actor->spr.clipdist << 2)+walldist;
|
||||
bsz = (actor->int_clipdist())+walldist;
|
||||
if (diff.Y < 0) bsz = -bsz;
|
||||
addclipline(p1.X+bsz, p1.Y-bsz, p1.X-bsz, p1.Y-bsz, obj, false);
|
||||
}
|
||||
|
@ -1018,7 +1018,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
{
|
||||
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
||||
{
|
||||
int32_t k = walldist+(actor->spr.clipdist<<2)+1;
|
||||
int32_t k = walldist+(actor->int_clipdist())+1;
|
||||
if ((abs(v1.X-pos.X) <= k) && (abs(v1.Y-pos.Y) <= k))
|
||||
{
|
||||
daz = actor->int_pos().Z + actor->GetOffsetAndHeight(k);
|
||||
|
|
|
@ -270,6 +270,11 @@ public:
|
|||
{
|
||||
return spr.clipdist * 0.25;
|
||||
}
|
||||
|
||||
int int_clipdist()
|
||||
{
|
||||
return spr. clipdist << 2;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -4532,7 +4532,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->int_vel().X >> 12, actor->int_vel().Y >> 12, actor->spr.clipdist << 2, (actor->int_pos().Z - top) / 4, (bottom - actor->int_pos().Z) / 4, CLIPMASK0, lhit);
|
||||
ClipMove(actor->spr.pos, &pSector, actor->int_vel().X >> 12, actor->int_vel().Y >> 12, actor->int_clipdist(), (actor->int_pos().Z - top) / 4, (bottom - actor->int_pos().Z) / 4, CLIPMASK0, lhit);
|
||||
actor->hit.hit = lhit;
|
||||
enginecompatibility_mode = bakCompat; // restore
|
||||
actor->spr.cstat = bakCstat;
|
||||
|
@ -4572,7 +4572,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->spr.clipdist << 2, CLIPMASK0);
|
||||
GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0);
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
|
||||
if ((actor->spr.flags & 2) && bottom < floorZ)
|
||||
|
@ -4599,7 +4599,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (CheckLink(actor)) GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->spr.clipdist << 2, CLIPMASK0);
|
||||
if (CheckLink(actor)) GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0);
|
||||
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
if (bottom >= floorZ)
|
||||
|
@ -4735,7 +4735,7 @@ void MoveDude(DBloodActor* actor)
|
|||
GetActorExtents(actor, &top, &bottom);
|
||||
int bz = (bottom - actor->int_pos().Z) / 4;
|
||||
int tz = (actor->int_pos().Z - top) / 4;
|
||||
int wd = actor->spr.clipdist << 2;
|
||||
int wd = actor->int_clipdist();
|
||||
auto pSector = actor->sector();
|
||||
int nAiStateType = (actor->xspr.aiState) ? actor->xspr.aiState->stateType : -1;
|
||||
|
||||
|
@ -5085,7 +5085,7 @@ void MoveDude(DBloodActor* actor)
|
|||
{
|
||||
int floorZ2 = floorZ;
|
||||
auto floorColl2 = floorColl;
|
||||
GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->spr.clipdist << 2, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR);
|
||||
GetZRange(actor, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR);
|
||||
if (bottom <= floorZ && actor->int_pos().Z - floorZ2 < bz)
|
||||
{
|
||||
floorZ = floorZ2;
|
||||
|
@ -5261,7 +5261,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->spr.clipdist << 2, (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1);
|
||||
ClipMove(ppos, &pSector2, vel.XY(), actor->int_clipdist(), (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1);
|
||||
enginecompatibility_mode = bakCompat; // restore
|
||||
actor->spr.cstat = bakSpriteCstat;
|
||||
auto pSector = pSector2;
|
||||
|
@ -5317,7 +5317,7 @@ int MoveMissile(DBloodActor* actor)
|
|||
}
|
||||
double ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
GetZRangeAtXYZ(ppos, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->spr.clipdist << 2, CLIPMASK0);
|
||||
GetZRangeAtXYZ(ppos, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, actor->int_clipdist(), CLIPMASK0);
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
top += vel.Z;
|
||||
bottom += vel.Z;
|
||||
|
|
|
@ -136,7 +136,7 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange)
|
|||
int z = actor->int_pos().Z;
|
||||
HitScan(actor, z, bcos(nAngle), bsin(nAngle), 0, CLIPMASK0, nRange);
|
||||
int nDist = approxDist(actor->spr.pos.XY() - gHitInfo.hitpos.XY());
|
||||
if (nDist - (actor->spr.clipdist << 2) < nRange)
|
||||
if (nDist - (actor->int_clipdist()) < nRange)
|
||||
{
|
||||
if (gHitInfo.actor() == nullptr || target == nullptr || target != gHitInfo.actor())
|
||||
return false;
|
||||
|
|
|
@ -749,7 +749,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
|
||||
if (hit >= 0)
|
||||
{
|
||||
targetDist = dist - (target->spr.clipdist << 2);
|
||||
targetDist = dist - (target->int_clipdist());
|
||||
objDist = approxDist(gHitInfo.hitpos.XY() - actor->spr.pos.XY());
|
||||
}
|
||||
|
||||
|
|
|
@ -289,8 +289,8 @@ void GibFX(DBloodActor* actor, GIBFX* pGFX, DVector3* pPos, CGibVelocity* pVel)
|
|||
if (!pPos && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
gPos.X = actor->spr.pos.X + MulScale(actor->spr.clipdist << 2, Cos(nAngle), 30) * inttoworld;
|
||||
gPos.Y = actor->spr.pos.Y + MulScale(actor->spr.clipdist << 2, Sin(nAngle), 30) * inttoworld;
|
||||
gPos.X = actor->spr.pos.X + MulScale(actor->int_clipdist(), Cos(nAngle), 30) * inttoworld;
|
||||
gPos.Y = actor->spr.pos.Y + MulScale(actor->int_clipdist(), Sin(nAngle), 30) * inttoworld;
|
||||
gPos.Z = bottom - Random(bottom - top);
|
||||
}
|
||||
auto pFX = gFX.fxSpawnActor(pGFX->fxId, pSector, gPos, 0);
|
||||
|
@ -360,8 +360,8 @@ void GibThing(DBloodActor* actor, GIBTHING* pGThing, DVector3* pPos, CGibVelocit
|
|||
if (!pPos)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
x = actor->int_pos().X + MulScale(actor->spr.clipdist << 2, Cos(nAngle), 30);
|
||||
y = actor->int_pos().Y + MulScale(actor->spr.clipdist << 2, Sin(nAngle), 30);
|
||||
x = actor->int_pos().X + MulScale(actor->int_clipdist(), Cos(nAngle), 30);
|
||||
y = actor->int_pos().Y + MulScale(actor->int_clipdist(), Sin(nAngle), 30);
|
||||
z = bottom - Random(bottom - top);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1655,7 +1655,7 @@ void debrisMove(int listIndex)
|
|||
moveHit.setNone();
|
||||
int floorDist = (bottom - actor->int_pos().Z) >> 2;
|
||||
int ceilDist = (actor->int_pos().Z - top) >> 2;
|
||||
int clipDist = actor->spr.clipdist << 2;
|
||||
int clipDist = actor->int_clipdist();
|
||||
int mass = actor->spriteMass.mass;
|
||||
|
||||
bool uwater = false;
|
||||
|
@ -7705,7 +7705,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle_, int n
|
|||
auto pSector = actor->sector();
|
||||
HitScan(actor, z, Cos(nAngle) >> 16, Sin(nAngle) >> 16, 0, CLIPMASK0, nRange);
|
||||
int nDist = approxDist(actor->spr.pos.XY() - gHitInfo.hitpos.XY());
|
||||
if (target != nullptr && nDist - (actor->spr.clipdist << 2) < nRange)
|
||||
if (target != nullptr && nDist - (actor->int_clipdist()) < nRange)
|
||||
return (target == gHitInfo.actor());
|
||||
|
||||
x += MulScale(nRange, Cos(nAngle), 30);
|
||||
|
|
|
@ -1844,7 +1844,7 @@ void playerProcess(PLAYER* pPlayer)
|
|||
GetActorExtents(actor, &top, &bottom);
|
||||
int dzb = (bottom - actor->int_pos().Z) / 4;
|
||||
int dzt = (actor->int_pos().Z - top) / 4;
|
||||
int dw = actor->spr.clipdist << 2;
|
||||
int dw = actor->int_clipdist();
|
||||
if (!gNoClip)
|
||||
{
|
||||
auto pSector = actor->sector();
|
||||
|
|
|
@ -768,7 +768,7 @@ void viewDrawScreen(bool sceneonly)
|
|||
gView->actor->spr.cstat = bakCstat;
|
||||
bDeliriumOld = bDelirium && gDeliriumBlur;
|
||||
|
||||
int nClipDist = gView->actor->spr.clipdist << 2;
|
||||
int nClipDist = gView->actor->int_clipdist();
|
||||
int vec, vf4;
|
||||
Collision c1, c2;
|
||||
GetZRange(gView->actor, &vf4, &c1, &vec, &c2, nClipDist, 0);
|
||||
|
|
|
@ -461,7 +461,7 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un
|
|||
if (actor->spr.picnum == LIZMAN)
|
||||
clipdist = 292;
|
||||
else if (actorflag(actor, SFLAG_BADGUY))
|
||||
clipdist = actor->spr.clipdist << 2;
|
||||
clipdist = actor->int_clipdist();
|
||||
else
|
||||
clipdist = 192;
|
||||
|
||||
|
@ -492,7 +492,7 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un
|
|||
if (actor->spr.statnum == STAT_PROJECTILE)
|
||||
clipmove(ppos, &dasectp, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 8, (4 << 8), (4 << 8), cliptype, result);
|
||||
else
|
||||
clipmove(ppos, &dasectp, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), (int)(actor->spr.clipdist << 2), (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), (int)(actor->int_clipdist()), (4 << 8), (4 << 8), cliptype, result);
|
||||
}
|
||||
actor->spr.pos.XY() = ppos.XY();
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
|
|||
|
||||
int nSpriteHeight = GetActorHeight(pActor);
|
||||
|
||||
int nClipDist = (int8_t)pActor->spr.clipdist << 2;
|
||||
int nClipDist = pActor->int_clipdist();
|
||||
|
||||
auto pSector = pActor->sector();
|
||||
assert(pSector);
|
||||
|
|
|
@ -882,7 +882,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
|
||||
auto pPlayerSect = pPlayerActor->sector();
|
||||
|
||||
pushmove(pPlayerActor, &pPlayerSect, pPlayerActor->spr.clipdist << 2, 5120, -5120, CLIPMASK0);
|
||||
pushmove(pPlayerActor, &pPlayerSect, pPlayerActor->int_clipdist(), 5120, -5120, CLIPMASK0);
|
||||
if (pPlayerSect != pPlayerActor->sector()) {
|
||||
ChangeActorSect(pPlayerActor, pPlayerSect);
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
auto nMov = MoveCreature(pActor);
|
||||
|
||||
auto sect = pActor->sector();
|
||||
pushmove(pActor, §, pActor->spr.clipdist << 2, 5120, -5120, CLIPMASK0);
|
||||
pushmove(pActor, §, pActor->int_clipdist(), 5120, -5120, CLIPMASK0);
|
||||
pActor->setsector(sect);
|
||||
|
||||
if (pActor->vel.Z > 4000/256.)
|
||||
|
|
|
@ -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->spr.clipdist<<2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
FAFgetzrange(pp->pos.plusZ(8), pp->cursector, &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)actor->int_clipdist()) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
actor->spr.cstat = bakcstat;
|
||||
|
||||
Collision ceilColl(ceilhit);
|
||||
|
@ -2009,7 +2009,7 @@ void DoPlayerSlide(PLAYER* pp)
|
|||
if (abs(pp->slide_vect.X) < 0.05 && abs(pp->slide_vect.Y) < 0.05)
|
||||
pp->slide_vect.Zero();
|
||||
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!(pp->Flags & PF_DEAD))
|
||||
|
@ -2023,10 +2023,10 @@ void DoPlayerSlide(PLAYER* pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->slide_vect.X), FloatToFixed<18>(pp->slide_vect.Y), ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->slide_vect.X), FloatToFixed<18>(pp->slide_vect.Y), ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!(pp->Flags & PF_DEAD))
|
||||
|
@ -2172,7 +2172,7 @@ void DoPlayerMove(PLAYER* pp)
|
|||
}
|
||||
else
|
||||
{
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
|
||||
if (push_ret < 0)
|
||||
{
|
||||
|
@ -2195,12 +2195,12 @@ void DoPlayerMove(PLAYER* pp)
|
|||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
Collision coll;
|
||||
updatesector(pp->pos, &pp->cursector);
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
actor->spr.cstat = save_cstat;
|
||||
PlayerCheckValidMove(pp);
|
||||
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
|
||||
|
@ -4832,7 +4832,7 @@ void DoPlayerCurrent(PLAYER* pp)
|
|||
xvect = sectu->speed * synctics * vect.X;
|
||||
yvect = sectu->speed * synctics * vect.Y;
|
||||
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!(pp->Flags & PF_DEAD))
|
||||
|
@ -4848,10 +4848,10 @@ void DoPlayerCurrent(PLAYER* pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
pushmove(pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
pushmove(pp->pos, &pp->cursector, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!(pp->Flags & PF_DEAD))
|
||||
|
|
|
@ -4555,7 +4555,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, (((int) actor->spr.clipdist) << 2) - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR);
|
||||
FAFgetzrange(pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->int_clipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR);
|
||||
actor->spr.cstat |= save_cstat;
|
||||
|
||||
actor->user.lo_sectp = actor->user.hi_sectp = nullptr;
|
||||
|
@ -6433,7 +6433,7 @@ Collision move_sprite(DSWActor* actor, const DVector3& change, double ceildist,
|
|||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(clip_pos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
(((int) actor->spr.clipdist) << 2), ceildist, flordist, cliptype, retval, 1);
|
||||
actor->int_clipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
|
||||
|
||||
actor->spr.pos.XY() = clip_pos.XY();
|
||||
|
@ -6458,7 +6458,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,
|
||||
(((int) actor->spr.clipdist) << 2) - GETZRANGE_CLIP_ADJ, cliptype);
|
||||
actor->int_clipdist() - GETZRANGE_CLIP_ADJ, cliptype);
|
||||
|
||||
actor->spr.cstat = tempstat;
|
||||
|
||||
|
@ -6655,7 +6655,7 @@ Collision move_missile(DSWActor* actor, const DVector3& change, double ceil_dist
|
|||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(clip_pos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
(((int) actor->spr.clipdist) << 2), ceil_dist, flor_dist, cliptype, retval, 1);
|
||||
actor->int_clipdist(), ceil_dist, flor_dist, cliptype, retval, 1);
|
||||
actor->spr.pos.XY() = clip_pos.XY();
|
||||
|
||||
if (dasect == nullptr)
|
||||
|
@ -6807,7 +6807,7 @@ Collision move_ground_missile(DSWActor* actor, const DVector2& change, double ce
|
|||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(opos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
(((int) actor->spr.clipdist) << 2), ceildist, flordist, cliptype, retval, 1);
|
||||
actor->int_clipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
actor->spr.pos.XY() = opos.XY();
|
||||
}
|
||||
|
||||
|
|
|
@ -11047,7 +11047,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, (((int) actor->spr.clipdist) << 2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
FAFgetzrange(actor->spr.pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, actor->int_clipdist() - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
actor->spr.cstat = save_cstat;
|
||||
|
||||
switch (florhit.type)
|
||||
|
@ -14315,7 +14315,7 @@ bool WallSpriteInsideSprite(DSWActor* wactor, DSWActor* actor)
|
|||
{
|
||||
DVector2 out[2];
|
||||
GetWallSpritePosition(&wactor->spr, wactor->spr.pos, out);
|
||||
return IsCloseToLine(actor->spr.pos.XY(), out[0], out[1], (((int) actor->spr.clipdist) << 2) * inttoworld) != EClose::Outside;
|
||||
return IsCloseToLine(actor->spr.pos.XY(), out[0], out[1], actor->fClipdist()) != EClose::Outside;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue