- Blood: don't pass an actor's position directly to ClipMove

This commit is contained in:
Christoph Oelckers 2022-01-30 17:05:05 +01:00
parent 4f391e46ce
commit 04c9422db8
2 changed files with 9 additions and 3 deletions

View file

@ -4541,7 +4541,9 @@ static Collision MoveThing(DBloodActor* actor)
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
if ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode()) if ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode())
enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, actor->spr.clipdist << 2, (actor->spr.pos.Z - top) / 4, (bottom - actor->spr.pos.Z) / 4, CLIPMASK0, lhit); auto pos = actor->spr.pos;
ClipMove(pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, actor->spr.clipdist << 2, (actor->spr.pos.Z - top) / 4, (bottom - actor->spr.pos.Z) / 4, CLIPMASK0, lhit);
actor->set_int_pos(pos);
actor->hit.hit = lhit; actor->hit.hit = lhit;
enginecompatibility_mode = bakCompat; // restore enginecompatibility_mode = bakCompat; // restore
actor->spr.cstat = bakCstat; actor->spr.cstat = bakCstat;
@ -4761,7 +4763,9 @@ void MoveDude(DBloodActor* actor)
{ {
auto bakCstat = actor->spr.cstat; auto bakCstat = actor->spr.cstat;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit); auto pos = actor->spr.pos;
ClipMove(pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit);
actor->set_int_pos(pos);
if (pSector == nullptr) if (pSector == nullptr)
{ {
pSector = actor->sector(); pSector = actor->sector();

View file

@ -1676,8 +1676,10 @@ void debrisMove(int listIndex)
auto oldcstat = actor->spr.cstat; auto oldcstat = actor->spr.cstat;
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, auto pos = actor->spr.pos;
ClipMove(pos, &pSector, actor->vel.X >> 12,
actor->vel.Y >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit); actor->vel.Y >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit);
actor->set_int_pos(pos);
actor->hit.hit = moveHit; actor->hit.hit = moveHit;
actor->spr.cstat = oldcstat; actor->spr.cstat = oldcstat;