mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- Duke: Remove player_struct::posoldAdd()
and player_struct::posoldGet()
.
This commit is contained in:
parent
f10f1b9154
commit
d1c5f9516f
7 changed files with 16 additions and 21 deletions
|
@ -171,6 +171,11 @@ public:
|
|||
return spr.pos.plusZ(viewzoffset);
|
||||
}
|
||||
|
||||
DVector3 getPrevPosWithOffsetZ()
|
||||
{
|
||||
return opos.plusZ(oviewzoffset);
|
||||
}
|
||||
|
||||
sectortype* sector() const
|
||||
{
|
||||
return spr.sectp;
|
||||
|
|
|
@ -3037,10 +3037,10 @@ void handle_se17(DDukeActor* actor)
|
|||
{
|
||||
int p = act3->PlayerIndex();
|
||||
|
||||
ps[p].posoldAdd(-ps[p].GetActor()->getPosWithOffsetZ());
|
||||
ps[p].GetActor()->spr.pos.XY() += act2->spr.pos.XY() - actor->spr.pos.XY();
|
||||
ps[p].GetActor()->spr.pos.Z += act2->sector()->floorz - sc->floorz;
|
||||
ps[p].posoldAdd(ps[p].GetActor()->getPosWithOffsetZ());
|
||||
act3->opos -= act3->spr.pos;
|
||||
act3->spr.pos.XY() += act2->spr.pos.XY() - actor->spr.pos.XY();
|
||||
act3->spr.pos.Z += act2->sector()->floorz - sc->floorz;
|
||||
act3->opos += act3->spr.pos;
|
||||
|
||||
if (q > 0) ps[p].GetActor()->backupz();
|
||||
|
||||
|
@ -4417,7 +4417,7 @@ void movefta(void)
|
|||
{
|
||||
int r1 = krand();
|
||||
int r2 = krand();
|
||||
canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].posoldGet().plusZ(-(r1 & 31)), ps[p].cursector);
|
||||
canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].GetActor()->getPrevPosWithOffsetZ().plusZ(-(r1 & 31)), ps[p].cursector);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ void drawoverlays(double interpfrac)
|
|||
}
|
||||
else
|
||||
{
|
||||
cposxy = interpolatedvalue(pp->posoldGet(), pp->GetActor()->getPosWithOffsetZ(), interpfrac).XY();
|
||||
cposxy = interpolatedvalue(pp->GetActor()->getPrevPosWithOffsetZ(), pp->GetActor()->getPosWithOffsetZ(), interpfrac).XY();
|
||||
cang = !SyncInput() ? pp->angle.ang : interpolatedvalue(pp->angle.oang, pp->angle.ang, interpfrac);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ int findplayer(const DDukeActor* actor, double* d)
|
|||
|
||||
if (ud.multimode < 2)
|
||||
{
|
||||
if (d) *d = (ps[myconnectindex].posoldGet() - s).plusZ(28).Sum();
|
||||
if (d) *d = (ps[myconnectindex].GetActor()->getPrevPosWithOffsetZ() - s).plusZ(28).Sum();
|
||||
return myconnectindex;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ int findplayer(const DDukeActor* actor, double* d)
|
|||
|
||||
for (j = connecthead; j >= 0; j = connectpoint2[j])
|
||||
{
|
||||
double x = (ps[j].posoldGet() - s).plusZ(28).Sum();
|
||||
double x = (ps[j].GetActor()->getPrevPosWithOffsetZ() - s).plusZ(28).Sum();
|
||||
if (x < closest && ps[j].GetActor()->spr.extra > 0)
|
||||
{
|
||||
closest_player = j;
|
||||
|
@ -263,7 +263,7 @@ int findotherplayer(int p, double* d)
|
|||
for (j = connecthead; j >= 0; j = connectpoint2[j])
|
||||
if (p != j && ps[j].GetActor()->spr.extra > 0)
|
||||
{
|
||||
double x = (ps[j].posoldGet() - ps[p].GetActor()->getPosWithOffsetZ()).Sum();
|
||||
double x = (ps[j].GetActor()->getPrevPosWithOffsetZ() - ps[p].GetActor()->getPosWithOffsetZ()).Sum();
|
||||
|
||||
if (x < closest)
|
||||
{
|
||||
|
|
|
@ -1516,7 +1516,7 @@ void checksectors_d(int snum)
|
|||
return;
|
||||
}
|
||||
if (p->newOwner != nullptr)
|
||||
neartag(p->posoldGet(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
else
|
||||
{
|
||||
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
|
|
|
@ -2466,7 +2466,7 @@ void checksectors_r(int snum)
|
|||
}
|
||||
|
||||
if (p->newOwner != nullptr)
|
||||
neartag(p->posoldGet(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
else
|
||||
{
|
||||
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
|
|
|
@ -334,16 +334,6 @@ struct player_struct
|
|||
{
|
||||
bobpos = GetActor()->spr.pos.XY();
|
||||
}
|
||||
|
||||
|
||||
void posoldAdd(const DVector3& val)
|
||||
{
|
||||
GetActor()->opos += val;
|
||||
}
|
||||
DVector3 posoldGet()
|
||||
{
|
||||
return GetActor()->opos.plusZ(GetActor()->viewzoffset);
|
||||
}
|
||||
};
|
||||
|
||||
struct Cycler
|
||||
|
|
Loading…
Reference in a new issue