- 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

@ -2298,10 +2298,7 @@ static void greenslime(DDukeActor *actor)
{ {
s5->spr.xvel = 0; s5->spr.xvel = 0;
int l = s5->int_ang(); actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5;
actor->set_int_pos({ s5->int_pos().X + bcos(l, -11), s5->int_pos().Y + bsin(l, -11), s5->int_pos().Z });
actor->spr.picnum = GREENSLIME + 2 + (global_random & 1); actor->spr.picnum = GREENSLIME + 2 + (global_random & 1);
if (actor->spr.yrepeat < 64) actor->spr.yrepeat += 2; 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; Collision coll;
auto pos = pActor->int_pos(); clipmove(pActor->spr.pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll);
clipmove(pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll);
pActor->set_int_pos(pos);
if (coll.type != kHitNone) // originally this or'ed the two values which can create unpredictable bad values in some edge cases. 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; 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)) if (pActor->spr.statnum >= 99 && nZVal == pActor->int_pos().Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{ {
pSectorB = pSector; pSectorB = pSector;
auto lpos = pActor->int_pos(); clipmove(pActor->spr.pos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
clipmove(lpos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
pActor->set_int_pos(lpos);
} }
} }
} }