- Duke: Remove player_struct::posSet().

This commit is contained in:
Mitchell Richters 2022-11-21 13:39:48 +11:00 committed by Christoph Oelckers
parent a1e68f88a5
commit 4551274e7d
6 changed files with 7 additions and 12 deletions

View file

@ -457,7 +457,7 @@ void moveplayers(void)
}
else
{
p->posSet(act->spr.pos.plusZ(-20));
p->GetActor()->spr.pos.Z += 20;
p->newOwner = nullptr;
if (p->wackedbyactor != nullptr && p->wackedbyactor->spr.statnum < MAXSTATUS)

View file

@ -2046,7 +2046,7 @@ void rr_specialstats()
if (act2->spr.picnum == RRTELEPORTDEST)
{
ps[p].angle.ang = act2->spr.angle;
ps[p].posSet(act2->spr.pos.plusZ(-36));
ps[p].GetActor()->spr.pos = act2->spr.pos.plusZ(-36 + gs.playerheight);
ps[p].GetActor()->backuppos();
ps[p].setbobpos();
auto pact = ps[p].GetActor();

View file

@ -2860,7 +2860,7 @@ void processinput_d(int snum)
checklook(snum,actions);
double iif = 2.5;
auto oldpos = p->posoldGet();
auto oldpos = p->GetActor()->opos;
if (p->on_crane != nullptr)
goto HORIZONLY;
@ -3101,7 +3101,7 @@ HORIZONLY:
{
if (!retry++)
{
p->posSet(oldpos);
p->GetActor()->spr.pos = oldpos;
p->GetActor()->backuppos();
continue;
}

View file

@ -3525,7 +3525,7 @@ void processinput_r(int snum)
checklook(snum, actions);
p->apply_seasick(1);
auto oldpos = p->posoldGet();
auto oldpos = p->GetActor()->opos;
if (p->on_crane != nullptr)
goto HORIZONLY;
@ -3888,7 +3888,7 @@ HORIZONLY:
{
if (!retry++)
{
p->posSet(oldpos);
p->GetActor()->spr.pos = oldpos;
p->GetActor()->backuppos();
continue;
}

View file

@ -336,11 +336,6 @@ struct player_struct
}
void posSet(const DVector3& val)
{
GetActor()->spr.pos = val.plusZ(-GetActor()->viewzoffset);
}
double& posoldX()
{
return GetActor()->opos.X;

View file

@ -702,7 +702,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backupxyz, dukeplayer_backupxyz)
void dukeplayer_setpos(player_struct* self, double x, double y, double z)
{
self->posSet({ x, y, z });
self->GetActor()->spr.pos = { x, y, z + self->GetActor()->viewzoffset };
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, setpos, dukeplayer_setpos)