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

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

View file

@ -3051,7 +3051,7 @@ void handle_se17(DDukeActor* actor)
ps[p].posZadd(act2->sector()->floorz - sc->floorz);
ps[p].posoldAdd(ps[p].posGet());
if (q > 0) ps[p].backupz();
if (q > 0) ps[p].GetActor()->backupz();
act3->floorz = act2->sector()->floorz;
act3->ceilingz = act2->sector()->ceilingz;

View file

@ -1374,7 +1374,7 @@ void movetransports_d(void)
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].posZset(Owner->spr.pos.Z - 24);
else ps[p].posZset(Owner->spr.pos.Z + 24);
ps[p].backupz();
ps[p].GetActor()->backupz();
auto pa = ps[p].GetActor();
pa->opos = ps[p].posGet();
@ -1398,7 +1398,7 @@ void movetransports_d(void)
if (ps[p].GetActor()->spr.extra > 0)
S_PlayActorSound(DUKE_UNDERWATER, act2);
ps[p].posZset(Owner->sector()->ceilingz + 7);
ps[p].backupz();
ps[p].GetActor()->backupz();
// this is actually below the precision óf the original Build coordinate system...
ps[p].vel.X = ((krand() & 8192) ? 1 / 64. : -1 / 64.);
@ -1417,7 +1417,7 @@ void movetransports_d(void)
S_PlayActorSound(DUKE_GASP, act2);
ps[p].posZset(Owner->sector()->floorz - 7);
ps[p].backupz();
ps[p].GetActor()->backupz();
ps[p].jumping_toggle = 1;
ps[p].jumping_counter = 0;

View file

@ -1259,7 +1259,7 @@ void movetransports_r(void)
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].posZset(Owner->spr.pos.Z - 24);
else ps[p].posZset(Owner->spr.pos.Z + 24);
ps[p].backupz();
ps[p].GetActor()->backupz();
ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(Owner->sector());
@ -1275,7 +1275,7 @@ void movetransports_r(void)
{
k = 2;
ps[p].posZset(Owner->sector()->ceilingz + 7);
ps[p].backupz();
ps[p].GetActor()->backupz();
}
if (onfloorz && sectlotag == 161 && ps[p].posZget() < sectp->ceilingz + 6)
@ -1283,7 +1283,7 @@ void movetransports_r(void)
k = 2;
if (ps[p].GetActor()->spr.extra <= 0) break;
ps[p].posZset(Owner->sector()->floorz - 49);
ps[p].backupz();
ps[p].GetActor()->backupz();
}
}
@ -1298,7 +1298,7 @@ void movetransports_r(void)
}
S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor());
ps[p].posZset(Owner->sector()->ceilingz + 7);
ps[p].backupz();
ps[p].GetActor()->backupz();
if (ps[p].OnMotorcycle)
ps[p].moto_underwater = 1;
}
@ -1314,7 +1314,7 @@ void movetransports_r(void)
S_PlayActorSound(DUKE_GASP, ps[p].GetActor());
ps[p].posZset(Owner->sector()->floorz - 7);
ps[p].backupz();
ps[p].GetActor()->backupz();
}
if (k == 1)

View file

@ -330,11 +330,6 @@ struct player_struct
return cursector != nullptr;
}
void backupz()
{
GetActor()->opos.Z = GetActor()->spr.pos.Z;
}
void setbobpos()
{
bobpos = GetActor()->spr.pos.XY();