- Duke: Clean up all player position calls referencing gs.playerheight that don't need it when using the sprite height.

This commit is contained in:
Mitchell Richters 2022-11-21 15:08:33 +11:00 committed by Christoph Oelckers
parent 29f2212d8f
commit b1bd59db41
9 changed files with 14 additions and 13 deletions

View file

@ -400,7 +400,7 @@ void moveplayers(void)
{
if (p->newOwner != nullptr) //Looking thru the camera
{
act->spr.pos = p->posoldGet().plusZ(gs.playerheight);
act->restorepos();
act->backupz();
act->spr.angle = p->angle.oang;
SetActor(act, act->spr.pos);
@ -3349,7 +3349,7 @@ void handle_se20(DDukeActor* actor)
ps[p].posAdd(vec);
ps[p].GetActor()->backupvec2();
SetActor(ps[p].GetActor(), ps[p].posGet().plusZ(gs.playerheight));
SetActor(ps[p].GetActor(), ps[p].GetActor()->spr.pos);
}
sc->addfloorxpan(-(float)vec.X * 2);

View file

@ -1345,7 +1345,7 @@ void movetransports_d(void)
ps[p].transporter_hold = 13;
}
ps[p].posSet(Owner->spr.pos.plusZ(-gs.playerheight));
ps[p].GetActor()->spr.pos = Owner->spr.pos;
ps[p].GetActor()->backuppos();
ps[p].setbobpos();
@ -1434,7 +1434,7 @@ void movetransports_d(void)
ps[p].setCursector(Owner->sector());
ChangeActorSect(act2, Owner->sector());
SetActor(ps[p].GetActor(), ps[p].posGet().plusZ(gs.playerheight));
SetActor(act2, act2->spr.pos);
if ((krand() & 255) < 32)
spawn(act2, WATERSPLASH2);

View file

@ -1233,7 +1233,7 @@ void movetransports_r(void)
ps[p].transporter_hold = 13;
}
ps[p].posSet(Owner->spr.pos.plusZ(-gs.playerheight + 4));
ps[p].GetActor()->spr.pos = Owner->spr.pos.plusZ(4);
ps[p].GetActor()->backuppos();
ps[p].setbobpos();

View file

@ -165,7 +165,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
auto pp = &ps[h->PlayerIndex()];
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner())
{
t->pos = interpolatedvalue(pp->posoldGet(), pp->posGet(), interpfrac).plusZ(gs.playerheight);
t->pos = h->interpolatedpos(interpfrac);
}
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
{

View file

@ -144,7 +144,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
auto pp = &ps[h->PlayerIndex()];
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner())
{
t->pos = interpolatedvalue(pp->posoldGet(), pp->posGet(), interpfrac).plusZ(gs.playerheight);
t->pos = h->interpolatedpos(interpfrac);
h->spr.scale = DVector2(0.375, 0.265625);
}
else if (!actorflag(h, SFLAG_NOINTERPOLATE))

View file

@ -2235,7 +2235,7 @@ int ParseState::parse(void)
ps[g_p].setbobpos();
g_ac->backuppos();
updatesector(ps[g_p].posGet(), &ps[g_p].cursector);
SetActor(ps[g_p].GetActor(), ps[g_p].posGet().plusZ(gs.playerheight ));
SetActor(ps[g_p].GetActor(), ps[g_p].GetActor()->spr.pos);
g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
g_ac->spr.shade = -12;

View file

@ -3063,7 +3063,7 @@ HORIZONLY:
}
// RBG***
SetActor(pact, p->posGet().plusZ(gs.playerheight));
SetActor(pact, p->GetActor()->spr.pos);
if (psectlotag < 3)
{

View file

@ -3839,7 +3839,7 @@ HORIZONLY:
}
// RBG***
SetActor(pact, p->posGet().plusZ(gs.playerheight));
SetActor(pact, p->GetActor()->spr.pos);
if (psectlotag == 800 && (!isRRRA() || !p->lotag800kill))
{

View file

@ -273,6 +273,9 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
// set screen rotation.
rotscrnang = !SyncInput() ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(interpfrac);
// use player's actor initially.
viewer = p->GetActor();
if ((snum == myconnectindex) && (numplayers > 1))
{
cpos = interpolatedvalue(omypos, mypos, interpfrac);
@ -290,7 +293,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
}
else
{
cpos = interpolatedvalue(p->posoldGet(), p->posGet(), interpfrac);
cpos = viewer->interpolatedpos(interpfrac).plusZ(viewer->viewzoffset);
if (SyncInput())
{
@ -320,14 +323,12 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
else if (p->over_shoulder_on == 0)
{
if (cl_viewbob) cpos.Z += interpolatedvalue(p->opyoff, p->pyoff, interpfrac);
viewer = p->GetActor();
}
else
{
auto adjustment = isRR() ? 15 : 12;
cpos.Z -= adjustment;
viewer = p->GetActor();
if (!calcChaseCamPos(cpos, viewer, &sect, cang, choriz, interpfrac, 64.))
{
cpos.Z += adjustment;