- Duke: Move player_struct::restorexyz() to DCoreActor::restorepos().

This commit is contained in:
Mitchell Richters 2022-11-20 19:03:27 +11:00 committed by Christoph Oelckers
parent a78d976352
commit 6eeedbd38a
7 changed files with 12 additions and 11 deletions

View file

@ -139,6 +139,12 @@ public:
backupang();
}
void restorepos()
{
spr.pos = opos;
viewzoffset = oviewzoffset;
}
sectortype* sector() const
{
return spr.sectp;

View file

@ -203,7 +203,7 @@ void checkavailweapon(player_struct* player)
void clearcamera(player_struct* ps)
{
ps->newOwner = nullptr;
ps->restorexyz();
ps->GetActor()->restorepos();
ps->angle.restore();
updatesector(ps->posGet(), &ps->cursector);

View file

@ -1734,7 +1734,7 @@ static void greenslime(DDukeActor *actor)
if (ps[p].newOwner != nullptr)
{
ps[p].newOwner = nullptr;
ps[p].restorexyz();
ps[p].GetActor()->restorepos();
ps[p].angle.restore();
updatesector(ps[p].posGet(), &ps[p].cursector);

View file

@ -2045,7 +2045,7 @@ int ParseState::parse(void)
if(!isRR() && ps[g_p].newOwner != nullptr)
{
ps[g_p].newOwner = nullptr;
ps[g_p].restorexyz();
ps[g_p].GetActor()->restorepos();
ps[g_p].angle.restore();
updatesector(ps[g_p].posGet(), &ps[g_p].cursector);

View file

@ -1061,7 +1061,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
if (ps[p].newOwner != nullptr)
{
ps[p].newOwner = nullptr;
ps[p].restorexyz();
ps[p].GetActor()->restorepos();
ps[p].angle.restore();
updatesector(ps[p].posGet(), &ps[p].cursector);
@ -1411,7 +1411,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
void clearcameras(player_struct* p)
{
p->restorexyz();
p->GetActor()->restorepos();
p->newOwner = nullptr;
updatesector(p->posGet(), &p->cursector);

View file

@ -1544,7 +1544,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
if (ps[p].newOwner != nullptr)
{
ps[p].newOwner = nullptr;
ps[p].restorexyz();
ps[p].GetActor()->restorepos();
updatesector(ps[p].posGet(), &ps[p].cursector);

View file

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