- Duke: Replace player_struct oposy with opos.Y calls.

This commit is contained in:
Mitchell Richters 2021-12-22 22:42:06 +11:00 committed by Christoph Oelckers
parent 0e897c29b0
commit 111aa16e64
19 changed files with 58 additions and 58 deletions

View file

@ -203,7 +203,7 @@ void clearcamera(player_struct* ps)
{
ps->newOwner = nullptr;
ps->pos.X = ps->opos.X;
ps->pos.Y = ps->oposy;
ps->pos.Y = ps->opos.Y;
ps->pos.Z = ps->oposz;
ps->angle.restore();
updatesector(ps->pos.X, ps->pos.Y, &ps->cursector);
@ -376,7 +376,7 @@ void movedummyplayers(void)
}
act->spr.pos.X += (ps[p].pos.X - ps[p].opos.X);
act->spr.pos.Y += (ps[p].pos.Y - ps[p].oposy);
act->spr.pos.Y += (ps[p].pos.Y - ps[p].opos.Y);
SetActor(act, act->spr.pos);
}
}
@ -402,7 +402,7 @@ void moveplayers(void)
if (p->newOwner != nullptr) //Looking thru the camera
{
act->spr.pos.X = p->opos.X;
act->spr.pos.Y = p->oposy;
act->spr.pos.Y = p->opos.Y;
act->spr.pos.Z = p->oposz + gs.playerheight;
act->spr.backupz();
act->spr.ang = p->angle.oang.asbuild();
@ -798,7 +798,7 @@ void movecrane(DDukeActor *actor, int crane)
{
auto ang = ps[p].angle.ang.asbuild();
ps[p].opos.X = ps[p].pos.X;
ps[p].oposy = ps[p].pos.Y;
ps[p].opos.Y = ps[p].pos.Y;
ps[p].oposz = ps[p].pos.Z;
ps[p].pos.X = actor->spr.pos.X - bcos(ang, -6);
ps[p].pos.Y = actor->spr.pos.Y - bsin(ang, -6);
@ -2901,7 +2901,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (numplayers > 1)
{
ps[p].opos.X = ps[p].pos.X;
ps[p].oposy = ps[p].pos.Y;
ps[p].opos.Y = ps[p].pos.Y;
}
if (psp->spr.extra <= 0)
{
@ -2945,7 +2945,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if ((k == nullptr && ud.clipping == 0) || (k == actor->spr.sector() && ps[p].cursector != actor->spr.sector()))
{
ps[p].opos.X = ps[p].pos.X = actor->spr.pos.X;
ps[p].oposy = ps[p].pos.Y = actor->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y = actor->spr.pos.Y;
ps[p].setCursector(actor->spr.sector());
SetActor(ps[p].GetActor(), actor->spr.pos);
@ -3066,7 +3066,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (numplayers > 1)
{
ps[p].opos.X = ps[p].pos.X;
ps[p].oposy = ps[p].pos.Y;
ps[p].opos.Y = ps[p].pos.Y;
}
ps[p].bobposx += l;
@ -3112,7 +3112,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
ps[p].pos.Y = actor->spr.pos.Y;
ps[p].opos.X = ps[p].pos.X;
ps[p].oposy = ps[p].pos.Y;
ps[p].opos.Y = ps[p].pos.Y;
ps[p].setCursector(actor->spr.sector());
@ -3934,7 +3934,7 @@ void handle_se17(DDukeActor* actor)
act3->ceilingz = act2->spr.sector()->ceilingz;
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X;
ps[p].bobposy = ps[p].oposy = ps[p].pos.Y;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y;
ps[p].oposz = ps[p].pos.Z;
ps[p].truefz = act3->floorz;
@ -4215,7 +4215,7 @@ void handle_se20(DDukeActor* actor)
ps[p].pos.Y += l;
ps[p].opos.X = ps[p].pos.X;
ps[p].oposy = ps[p].pos.Y;
ps[p].opos.Y = ps[p].pos.Y;
SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z + gs.playerheight });
}

View file

@ -625,7 +625,7 @@ void movefta_d(void)
if (badguy(act))
{
px = ps[p].opos.X + 64 - (krand() & 127);
py = ps[p].oposy + 64 - (krand() & 127);
py = ps[p].opos.Y + 64 - (krand() & 127);
updatesector(px, py, &psect);
if (psect == nullptr)
{
@ -647,7 +647,7 @@ void movefta_d(void)
{
int r1 = krand();
int r2 = krand();
j = cansee(act->spr.pos.X, act->spr.pos.Y, act->spr.pos.Z - ((r2 & 31) << 8), act->spr.sector(), ps[p].opos.X, ps[p].oposy, ps[p].oposz - ((r1 & 31) << 8), ps[p].cursector);
j = cansee(act->spr.pos.X, act->spr.pos.Y, act->spr.pos.Z - ((r2 & 31) << 8), act->spr.sector(), ps[p].opos.X, ps[p].opos.Y, ps[p].oposz - ((r1 & 31) << 8), ps[p].cursector);
}
@ -1941,7 +1941,7 @@ void movetransports_d(void)
}
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].oposz = ps[p].pos.Z = Owner->spr.pos.Z - gs.playerheight;
ChangeActorSect(act2, Owner->sector());
@ -1963,7 +1963,7 @@ void movetransports_d(void)
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{
ps[p].opos.X = ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X;
ps[p].oposy = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].pos.Z = Owner->spr.pos.Z - 6144;
@ -2019,7 +2019,7 @@ void movetransports_d(void)
if (k == 1)
{
ps[p].opos.X = ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X;
ps[p].oposy = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
if (!Owner || Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2;
@ -2339,7 +2339,7 @@ static void greenslime(DDukeActor *actor)
{
ps[p].newOwner = nullptr;
ps[p].pos.X = ps[p].opos.X;
ps[p].pos.Y = ps[p].oposy;
ps[p].pos.Y = ps[p].opos.Y;
ps[p].pos.Z = ps[p].oposz;
ps[p].angle.restore();
@ -3682,7 +3682,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (a & face_player)
{
if (ps[playernum].newOwner != nullptr)
goalang = getangle(ps[playernum].opos.X - actor->spr.pos.X, ps[playernum].oposy - actor->spr.pos.Y);
goalang = getangle(ps[playernum].opos.X - actor->spr.pos.X, ps[playernum].opos.Y - actor->spr.pos.Y);
else goalang = getangle(ps[playernum].pos.X - actor->spr.pos.X, ps[playernum].pos.Y - actor->spr.pos.Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
@ -3695,7 +3695,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (a & face_player_slow)
{
if (ps[playernum].newOwner != nullptr)
goalang = getangle(ps[playernum].opos.X - actor->spr.pos.X, ps[playernum].oposy - actor->spr.pos.Y);
goalang = getangle(ps[playernum].opos.X - actor->spr.pos.X, ps[playernum].opos.Y - actor->spr.pos.Y);
else goalang = getangle(ps[playernum].pos.X - actor->spr.pos.X, ps[playernum].pos.Y - actor->spr.pos.Y);
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)

View file

@ -523,7 +523,7 @@ void movefta_r(void)
if (badguy(act))
{
px = ps[p].opos.X + 64 - (krand() & 127);
py = ps[p].oposy + 64 - (krand() & 127);
py = ps[p].opos.Y + 64 - (krand() & 127);
updatesector(px, py, &psect);
if (psect == nullptr)
{
@ -552,7 +552,7 @@ void movefta_r(void)
{
int r1 = krand();
int r2 = krand();
j = cansee(act->spr.pos.X, act->spr.pos.Y, act->spr.pos.Z - ((r2 & 31) << 8), act->spr.sector(), ps[p].opos.X, ps[p].oposy, ps[p].oposz - ((r1 & 31) << 8), ps[p].cursector);
j = cansee(act->spr.pos.X, act->spr.pos.Y, act->spr.pos.Z - ((r2 & 31) << 8), act->spr.sector(), ps[p].opos.X, ps[p].opos.Y, ps[p].oposz - ((r1 & 31) << 8), ps[p].cursector);
}
@ -1605,7 +1605,7 @@ void movetransports_r(void)
}
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].oposz = ps[p].pos.Z = Owner->spr.pos.Z - (gs.playerheight - (4 << 8));
ChangeActorSect(act2, Owner->sector());
@ -1624,7 +1624,7 @@ void movetransports_r(void)
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{
ps[p].opos.X = ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X;
ps[p].oposy = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].pos.Z = Owner->spr.pos.Z - 6144;
@ -1690,7 +1690,7 @@ void movetransports_r(void)
if (k == 1)
{
ps[p].opos.X = ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X;
ps[p].oposy = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
if (Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2;
@ -1704,7 +1704,7 @@ void movetransports_r(void)
else if (isRRRA() && k == 2)
{
ps[p].opos.X = ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X;
ps[p].oposy = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
ps[p].opos.Y = ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y;
if (Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2;
@ -2450,7 +2450,7 @@ void rr_specialstats()
{
ps[p].angle.ang = buildang(act2->spr.ang);
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = act2->spr.pos.X;
ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = act2->spr.pos.Y;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = act2->spr.pos.Y;
ps[p].oposz = ps[p].pos.Z = act2->spr.pos.Z - (36 << 8);
auto pact = ps[p].GetActor();
ChangeActorSect(pact, act2->sector());
@ -3657,7 +3657,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & face_player)
{
if (ps[pnum].newOwner != nullptr)
goalang = getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].oposy - actor->spr.pos.Y);
goalang = getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].opos.Y - actor->spr.pos.Y);
else goalang = getangle(ps[pnum].pos.X - actor->spr.pos.X, ps[pnum].pos.Y - actor->spr.pos.Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
@ -3670,7 +3670,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & face_player_slow)
{
if (ps[pnum].newOwner != nullptr)
goalang = getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].oposy - actor->spr.pos.Y);
goalang = getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].opos.Y - actor->spr.pos.Y);
else goalang = getangle(ps[pnum].pos.X - actor->spr.pos.X, ps[pnum].pos.Y - actor->spr.pos.Y);
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)
@ -3686,7 +3686,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & antifaceplayerslow)
{
if (ps[pnum].newOwner != nullptr)
goalang = (getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].oposy - actor->spr.pos.Y) + 1024) & 2047;
goalang = (getangle(ps[pnum].opos.X - actor->spr.pos.X, ps[pnum].opos.Y - actor->spr.pos.Y) + 1024) & 2047;
else goalang = (getangle(ps[pnum].pos.X - actor->spr.pos.X, ps[pnum].pos.Y - actor->spr.pos.Y) + 1024) & 2047;
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)

View file

@ -166,7 +166,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner())
{
t->pos.X -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].opos.X, 16);
t->pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].oposy, 16);
t->pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].opos.Y, 16);
t->pos.Z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.Z, smoothratio);
t->pos.Z += PHEIGHT_DUKE;
}

View file

@ -147,7 +147,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner())
{
t->pos.X -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].opos.X, 16);
t->pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].oposy, 16);
t->pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].opos.Y, 16);
t->pos.Z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.Z, smoothratio);
t->pos.Z += PHEIGHT_RR;
h->spr.xrepeat = 24;

View file

@ -116,7 +116,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
player_struct* p = &ps[myconnectindex];
p->opos.X = p->pos.X = x;
p->oposy = p->pos.Y = y;
p->opos.Y = p->pos.Y = y;
p->oposz = p->pos.Z = z;
if (ang != INT_MIN)

View file

@ -271,14 +271,14 @@ void drawoverlays(double smoothratio)
else
{
cposx = interpolatedvalue(pp->opos.X, pp->pos.X, smoothratio);
cposy = interpolatedvalue(pp->oposy, pp->pos.Y, smoothratio);
cposy = interpolatedvalue(pp->opos.Y, pp->pos.Y, smoothratio);
cang = (!SyncInput() ? pp->angle.ang : interpolatedangle(pp->angle.oang, pp->angle.ang, smoothratio)).asbuild();
}
}
else
{
cposx = pp->opos.X;
cposy = pp->oposy;
cposy = pp->opos.Y;
cang = pp->angle.oang.asbuild();
}
DrawOverheadMap(cposx, cposy, cang, smoothratio);

View file

@ -383,8 +383,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_OPOSY:
if (bSet) ps[iPlayer].oposy = lValue;
else SetGameVarID(lVar2, ps[iPlayer].oposy, sActor, sPlayer);
if (bSet) ps[iPlayer].opos.Y = lValue;
else SetGameVarID(lVar2, ps[iPlayer].opos.Y, sActor, sPlayer);
break;
case PLAYER_OPOSZ:
@ -2067,7 +2067,7 @@ int ParseState::parse(void)
{
ps[g_p].newOwner = nullptr;
ps[g_p].pos.X = ps[g_p].opos.X;
ps[g_p].pos.Y = ps[g_p].oposy;
ps[g_p].pos.Y = ps[g_p].opos.Y;
ps[g_p].pos.Z = ps[g_p].oposz;
ps[g_p].angle.restore();
updatesector(ps[g_p].pos.X,ps[g_p].pos.Y,&ps[g_p].cursector);
@ -2246,7 +2246,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.X = ps[g_p].bobposx = ps[g_p].opos.X = ps[g_p].pos.X;
g_ac->spr.pos.Y = ps[g_p].bobposy = ps[g_p].oposy = ps[g_p].pos.Y;
g_ac->spr.pos.Y = ps[g_p].bobposy = ps[g_p].opos.Y = ps[g_p].pos.Y;
g_ac->spr.pos.Z = ps[g_p].oposz = ps[g_p].pos.Z;
g_ac->spr.backuppos();
updatesector(ps[g_p].pos.X, ps[g_p].pos.Y, &ps[g_p].cursector);

View file

@ -746,12 +746,12 @@ void player_struct::backuppos(bool noclipping)
if (!noclipping)
{
opos.X = pos.X;
oposy = pos.Y;
opos.Y = pos.Y;
}
else
{
pos.X = opos.X;
pos.Y = oposy;
pos.Y = opos.Y;
}
oposz = pos.Z;
@ -1066,7 +1066,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, invdisptime)
DEFINE_FIELD_X(DukePlayer, player_struct, bobposx)
DEFINE_FIELD_X(DukePlayer, player_struct, bobposy)
//DEFINE_FIELD_X(DukePlayer, player_struct, oposx)
DEFINE_FIELD_X(DukePlayer, player_struct, oposy)
//DEFINE_FIELD_X(DukePlayer, player_struct, oposy)
DEFINE_FIELD_X(DukePlayer, player_struct, oposz)
DEFINE_FIELD_X(DukePlayer, player_struct, pyoff)
DEFINE_FIELD_X(DukePlayer, player_struct, opyoff)

View file

@ -159,7 +159,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
{
int x;
int j = findplayer(actor, &x);
sa = getangle(ps[j].opos.X - sx, ps[j].oposy - sy);
sa = getangle(ps[j].opos.X - sx, ps[j].opos.Y - sy);
if (actor->spr.picnum == BOSS5)
{
@ -184,7 +184,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
zvel = -MulScale(ps[p].horizon.sum().asq16(), 81, 16);
if (ps[p].GetActor()->spr.xvel != 0)
vel = (int)((((512 - (1024
- abs(abs(getangle(sx - ps[p].opos.X, sy - ps[p].oposy) - sa) - 1024)))
- abs(abs(getangle(sx - ps[p].opos.X, sy - ps[p].opos.Y) - sa) - 1024)))
* 0.001953125f) * ps[p].GetActor()->spr.xvel) + 400);
if (actor->spr.sector()->lotag == 2 && (krand() % 5) == 0)
spawned = spawn(actor, WATERBUBBLE);
@ -706,7 +706,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
{
int x;
int j = findplayer(actor, &x);
sa = getangle(ps[j].opos.X - sx, ps[j].oposy - sy);
sa = getangle(ps[j].opos.X - sx, ps[j].opos.Y - sy);
if (actor->spr.picnum == BOSS3)
{
int zoffs = (32 << 8);

View file

@ -644,7 +644,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
{
int x;
int j = findplayer(actor, &x);
sa = getangle(ps[j].opos.X - sx, ps[j].oposy - sy);
sa = getangle(ps[j].opos.X - sx, ps[j].opos.Y - sy);
if (actor->spr.picnum == BOSS3)
sz -= (32 << 8);
else if (actor->spr.picnum == BOSS2)

View file

@ -61,7 +61,7 @@ void pickrandomspot(int snum)
else i = snum;
p->bobposx = p->opos.X = p->pos.X = po[i].ox;
p->bobposy = p->oposy = p->pos.Y = po[i].oy;
p->bobposy = p->opos.Y = p->pos.Y = po[i].oy;
p->oposz = p->pos.Z = po[i].oz;
p->angle.oang = p->angle.ang = buildang(po[i].oa);
p->setCursector(po[i].os);
@ -626,7 +626,7 @@ void resetpspritevars(int g)
act->SetOwner(act);
ps[j].bobposx = ps[j].opos.X = ps[j].pos.X = act->spr.pos.X;
ps[j].bobposy = ps[j].oposy = ps[j].pos.Y = act->spr.pos.Y;
ps[j].bobposy = ps[j].opos.Y = ps[j].pos.Y = act->spr.pos.Y;
ps[j].oposz = ps[j].pos.Z = act->spr.pos.Z;
act->spr.backuppos();
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang);

View file

@ -328,7 +328,7 @@ void displayrooms(int snum, double smoothratio)
#endif
{
cposx = interpolatedvalue(p->opos.X, p->pos.X, smoothratio);
cposy = interpolatedvalue(p->oposy, p->pos.Y, smoothratio);
cposy = interpolatedvalue(p->opos.Y, p->pos.Y, smoothratio);
cposz = interpolatedvalue(p->oposz, p->pos.Z, smoothratio);;
if (SyncInput())
{

View file

@ -278,7 +278,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
w.invdisptime = 0;
w.opos.X = w.pos.X;
w.oposy = w.pos.Y;
w.opos.Y = w.pos.Y;
w.oposz = w.pos.Z;
w.opyoff = w.pyoff;
w.oweapon_sway = w.weapon_sway;

View file

@ -220,7 +220,7 @@ int findplayer(const DDukeActor* actor, int* d)
if (ud.multimode < 2)
{
if (d) *d = abs(ps[myconnectindex].opos.X - s->X) + abs(ps[myconnectindex].oposy - s->Y) + ((abs(ps[myconnectindex].oposz - s->Z + (28 << 8))) >> 4);
if (d) *d = abs(ps[myconnectindex].opos.X - s->X) + abs(ps[myconnectindex].opos.Y - s->Y) + ((abs(ps[myconnectindex].oposz - s->Z + (28 << 8))) >> 4);
return myconnectindex;
}
@ -229,7 +229,7 @@ int findplayer(const DDukeActor* actor, int* d)
for (j = connecthead; j >= 0; j = connectpoint2[j])
{
x = abs(ps[j].opos.X - s->X) + abs(ps[j].oposy - s->Y) + ((abs(ps[j].oposz - s->Z + (28 << 8))) >> 4);
x = abs(ps[j].opos.X - s->X) + abs(ps[j].opos.Y - s->Y) + ((abs(ps[j].oposz - s->Z + (28 << 8))) >> 4);
if (x < closest && ps[j].GetActor()->spr.extra > 0)
{
closest_player = j;
@ -258,7 +258,7 @@ int findotherplayer(int p, int* d)
for (j = connecthead; j >= 0; j = connectpoint2[j])
if (p != j && ps[j].GetActor()->spr.extra > 0)
{
x = abs(ps[j].opos.X - ps[p].pos.X) + abs(ps[j].oposy - ps[p].pos.Y) + (abs(ps[j].oposz - ps[p].pos.Z) >> 4);
x = abs(ps[j].opos.X - ps[p].pos.X) + abs(ps[j].opos.Y - ps[p].pos.Y) + (abs(ps[j].oposz - ps[p].pos.Z) >> 4);
if (x < closest)
{

View file

@ -1465,7 +1465,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
{
ps[p].newOwner = nullptr;
ps[p].pos.X = ps[p].opos.X;
ps[p].pos.Y = ps[p].oposy;
ps[p].pos.Y = ps[p].opos.Y;
ps[p].pos.Z = ps[p].oposz;
ps[p].angle.restore();
@ -1503,7 +1503,7 @@ void clearcameras(int i, player_struct* p)
if (i < 0)
{
p->pos.X = p->opos.X;
p->pos.Y = p->oposy;
p->pos.Y = p->opos.Y;
p->pos.Z = p->oposz;
p->newOwner = nullptr;
@ -1616,7 +1616,7 @@ void checksectors_d(int snum)
return;
}
if (p->newOwner != nullptr)
neartag({ p->opos.X, p->oposy, p->oposz }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
neartag({ p->opos.X, p->opos.Y, p->oposz }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
else
{
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);

View file

@ -2413,7 +2413,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
{
ps[p].newOwner = nullptr;
ps[p].pos.X = ps[p].opos.X;
ps[p].pos.Y = ps[p].oposy;
ps[p].pos.Y = ps[p].opos.Y;
ps[p].pos.Z = ps[p].oposz;
updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector);
@ -2569,7 +2569,7 @@ void checksectors_r(int snum)
}
if (p->newOwner != nullptr)
neartag({ p->opos.X, p->oposy, p->oposz }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
neartag({ p->opos.X, p->opos.Y, p->oposz }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
else
{
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);

View file

@ -216,7 +216,7 @@ struct player_struct
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
int exitx, exity, loogiex[64], loogiey[64], numloogs, loogcnt;
int invdisptime;
int bobposx, bobposy, oposy, oposz, pyoff, opyoff;
int bobposx, bobposy, oposz, pyoff, opyoff;
int posxv, posyv, poszv, last_pissed_time, truefz, truecz;
int player_par, visibility;
int bobcounter;

View file

@ -152,7 +152,7 @@ struct DukePlayer
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
native int exitx, exity, loogiex[64], loogiey[64], numloogs, loogcnt;
native int invdisptime;
native int bobposx, bobposy, oposy, oposz, pyoff, opyoff;
native int bobposx, bobposy, oposz, pyoff, opyoff;
native int posxv, posyv, poszv, last_pissed_time, truefz, truecz;
native int player_par, visibility;
native int bobcounter;