- Duke: Remove player_struct::backupxyz() in lieu of actor variant.

This commit is contained in:
Mitchell Richters 2022-11-15 19:27:07 +11:00 committed by Christoph Oelckers
parent 0ab175b894
commit a78d976352
10 changed files with 10 additions and 15 deletions

View file

@ -1346,7 +1346,7 @@ void movetransports_d(void)
}
ps[p].posSet(Owner->spr.pos.plusZ(-gs.playerheight));
ps[p].backupxyz();
ps[p].GetActor()->backuppos();
ps[p].setbobpos();
ChangeActorSect(act2, Owner->sector());

View file

@ -1234,7 +1234,7 @@ void movetransports_r(void)
}
ps[p].posSet(Owner->spr.pos.plusZ(-gs.playerheight + 4));
ps[p].backupxyz();
ps[p].GetActor()->backuppos();
ps[p].setbobpos();
ChangeActorSect(act2, Owner->sector());
@ -2050,7 +2050,7 @@ void rr_specialstats()
{
ps[p].angle.ang = act2->spr.angle;
ps[p].posSet(act2->spr.pos.plusZ(-36));
ps[p].backupxyz();
ps[p].GetActor()->backuppos();
ps[p].setbobpos();
auto pact = ps[p].GetActor();
ChangeActorSect(pact, act2->sector());

View file

@ -116,7 +116,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
player_struct* p = &ps[myconnectindex];
p->posSet(DVector3(x, y, z));
p->backupxyz();
p->GetActor()->backuppos();
if (ang != DAngle::fromDeg(INT_MIN))
{

View file

@ -2231,7 +2231,7 @@ int ParseState::parse(void)
// I am not convinced this is even remotely smart to be executed from here..
pickrandomspot(g_p);
g_ac->spr.pos = ps[g_p].posGet();
ps[g_p].backupxyz();
ps[g_p].GetActor()->backuppos();
ps[g_p].setbobpos();
g_ac->backuppos();
updatesector(ps[g_p].posGet(), &ps[g_p].cursector);

View file

@ -3102,7 +3102,7 @@ HORIZONLY:
if (!retry++)
{
p->posSet(oldpos);
p->backupxyz();
p->GetActor()->backuppos();
continue;
}
quickkill(p);

View file

@ -3889,7 +3889,7 @@ HORIZONLY:
if (!retry++)
{
p->posSet(oldpos);
p->backupxyz();
p->GetActor()->backuppos();
continue;
}
quickkill(p);

View file

@ -70,7 +70,7 @@ void pickrandomspot(int snum)
else i = snum;
p->GetActor()->spr.pos = po[i].opos;
p->backupxyz();
p->GetActor()->backuppos();
p->setbobpos();
p->angle.oang = p->angle.ang = po[i].oa;
p->setCursector(po[i].os);

View file

@ -243,7 +243,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
.EndObject();
w.invdisptime = 0;
w.backupxyz();
w.GetActor()->backuppos();
w.opyoff = w.pyoff;
w.backupweapon();
w.sync.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.

View file

@ -330,11 +330,6 @@ struct player_struct
return cursector != nullptr;
}
void backupxyz()
{
GetActor()->opos = GetActor()->spr.pos;
}
void restorexyz()
{
GetActor()->spr.pos = GetActor()->opos;

View file

@ -690,7 +690,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backuppos, dukeplayer_backuppos)
void dukeplayer_backupxyz(player_struct* self)
{
self->backupxyz();
self->GetActor()->backuppos();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backupxyz, dukeplayer_backupxyz)