mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- Duke: Wrap calls that get player_struct::PlayerOldPosition
.
This commit is contained in:
parent
1962d85f99
commit
b0c95f69c5
11 changed files with 17 additions and 13 deletions
|
@ -400,7 +400,7 @@ void moveplayers(void)
|
|||
{
|
||||
if (p->newOwner != nullptr) //Looking thru the camera
|
||||
{
|
||||
act->spr.pos = p->PlayerOldPosition.plusZ(gs.playerheight);
|
||||
act->spr.pos = p->posoldGet().plusZ(gs.playerheight);
|
||||
act->backupz();
|
||||
act->spr.angle = p->angle.oang;
|
||||
SetActor(act, act->spr.pos);
|
||||
|
@ -4444,7 +4444,7 @@ void movefta(void)
|
|||
{
|
||||
int r1 = krand();
|
||||
int r2 = krand();
|
||||
canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].PlayerOldPosition.plusZ(-(r1 & 31)), ps[p].cursector);
|
||||
canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].posoldGet().plusZ(-(r1 & 31)), ps[p].cursector);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
auto pp = &ps[h->PlayerIndex()];
|
||||
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner())
|
||||
{
|
||||
t->pos = interpolatedvalue(pp->PlayerOldPosition, pp->posGet(), interpfrac).plusZ(gs.playerheight);
|
||||
t->pos = interpolatedvalue(pp->posoldGet(), pp->posGet(), interpfrac).plusZ(gs.playerheight);
|
||||
}
|
||||
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
||||
{
|
||||
|
|
|
@ -144,7 +144,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
auto pp = &ps[h->PlayerIndex()];
|
||||
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner())
|
||||
{
|
||||
t->pos = interpolatedvalue(pp->PlayerOldPosition, pp->posGet(), interpfrac).plusZ(gs.playerheight);
|
||||
t->pos = interpolatedvalue(pp->posoldGet(), pp->posGet(), interpfrac).plusZ(gs.playerheight);
|
||||
h->spr.scale = DVector2(0.375, 0.265625);
|
||||
}
|
||||
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
||||
|
|
|
@ -271,7 +271,7 @@ void drawoverlays(double interpfrac)
|
|||
}
|
||||
else
|
||||
{
|
||||
cposxy = interpolatedvalue(pp->PlayerOldPosition, pp->posGet(), interpfrac).XY();
|
||||
cposxy = interpolatedvalue(pp->posoldGet(), pp->posGet(), interpfrac).XY();
|
||||
cang = !SyncInput() ? pp->angle.ang : interpolatedvalue(pp->angle.oang, pp->angle.ang, interpfrac);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2860,7 +2860,7 @@ void processinput_d(int snum)
|
|||
|
||||
checklook(snum,actions);
|
||||
double iif = 2.5;
|
||||
auto oldpos = p->PlayerOldPosition;
|
||||
auto oldpos = p->posoldGet();
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
goto HORIZONLY;
|
||||
|
|
|
@ -3525,7 +3525,7 @@ void processinput_r(int snum)
|
|||
checklook(snum, actions);
|
||||
p->apply_seasick(1);
|
||||
|
||||
auto oldpos = p->PlayerOldPosition;
|
||||
auto oldpos = p->posoldGet();
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
goto HORIZONLY;
|
||||
|
|
|
@ -290,7 +290,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
|
|||
}
|
||||
else
|
||||
{
|
||||
cpos = interpolatedvalue(p->PlayerOldPosition, p->posGet(), interpfrac);
|
||||
cpos = interpolatedvalue(p->posoldGet(), p->posGet(), interpfrac);
|
||||
|
||||
if (SyncInput())
|
||||
{
|
||||
|
|
|
@ -226,7 +226,7 @@ int findplayer(const DDukeActor* actor, double* d)
|
|||
|
||||
if (ud.multimode < 2)
|
||||
{
|
||||
if (d) *d = (ps[myconnectindex].PlayerOldPosition - s).plusZ(28).Sum();
|
||||
if (d) *d = (ps[myconnectindex].posoldGet() - 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].PlayerOldPosition - s).plusZ(28).Sum();
|
||||
double x = (ps[j].posoldGet() - 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].PlayerOldPosition - ps[p].posGet()).Sum();
|
||||
double x = (ps[j].posoldGet() - ps[p].posGet()).Sum();
|
||||
|
||||
if (x < closest)
|
||||
{
|
||||
|
|
|
@ -1516,7 +1516,7 @@ void checksectors_d(int snum)
|
|||
return;
|
||||
}
|
||||
if (p->newOwner != nullptr)
|
||||
neartag(p->PlayerOldPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
neartag(p->posoldGet(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
else
|
||||
{
|
||||
neartag(p->posGet(), 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->PlayerOldPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
neartag(p->posoldGet(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
else
|
||||
{
|
||||
neartag(p->posGet(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
|
||||
|
|
|
@ -427,6 +427,10 @@ struct player_struct
|
|||
{
|
||||
PlayerOldPosition += val;
|
||||
}
|
||||
DVector3 posoldGet()
|
||||
{
|
||||
return PlayerOldPosition;
|
||||
}
|
||||
};
|
||||
|
||||
struct Cycler
|
||||
|
|
Loading…
Reference in a new issue