- 3 simple set_int_pos replacements

This commit is contained in:
Christoph Oelckers 2022-08-30 21:36:09 +02:00
parent ac3302733f
commit 559c24fa92
2 changed files with 4 additions and 12 deletions

View file

@ -2297,11 +2297,8 @@ static void greenslime(DDukeActor *actor)
if (s5)
{
s5->spr.xvel = 0;
int l = s5->int_ang();
actor->set_int_pos({ s5->int_pos().X + bcos(l, -11), s5->int_pos().Y + bsin(l, -11), s5->int_pos().Z });
actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5;
actor->spr.picnum = GREENSLIME + 2 + (global_random & 1);
if (actor->spr.yrepeat < 64) actor->spr.yrepeat += 2;

View file

@ -535,9 +535,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
}
Collision coll;
auto pos = pActor->int_pos();
clipmove(pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll);
pActor->set_int_pos(pos);
clipmove(pActor->spr.pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll);
if (coll.type != kHitNone) // originally this or'ed the two values which can create unpredictable bad values in some edge cases.
{
coll.exbits = nRet.exbits;
@ -1028,10 +1026,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
if (pActor->spr.statnum >= 99 && nZVal == pActor->int_pos().Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
pSectorB = pSector;
auto lpos = pActor->int_pos();
clipmove(lpos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
pActor->set_int_pos(lpos);
clipmove(pActor->spr.pos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
}
}
}