mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- renamed player_struct::opos
This commit is contained in:
parent
5f4c35e9aa
commit
564ec9e518
20 changed files with 132 additions and 130 deletions
|
@ -202,7 +202,7 @@ void checkavailweapon(struct player_struct* player)
|
|||
void clearcamera(player_struct* ps)
|
||||
{
|
||||
ps->newOwner = nullptr;
|
||||
ps->__int_pos = ps->opos;
|
||||
ps->__int_pos = ps->__int_opos;
|
||||
ps->angle.restore();
|
||||
updatesector(ps->__int_pos.X, ps->__int_pos.Y, &ps->cursector);
|
||||
|
||||
|
@ -372,7 +372,7 @@ void movedummyplayers(void)
|
|||
}
|
||||
}
|
||||
|
||||
act->add_int_pos({ (ps[p].__int_pos.X - ps[p].opos.X), (ps[p].__int_pos.Y - ps[p].opos.Y), 0 });
|
||||
act->add_int_pos({ (ps[p].__int_pos.X - ps[p].__int_opos.X), (ps[p].__int_pos.Y - ps[p].__int_opos.Y), 0 });
|
||||
SetActor(act, act->int_pos());
|
||||
}
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ void moveplayers(void)
|
|||
{
|
||||
if (p->newOwner != nullptr) //Looking thru the camera
|
||||
{
|
||||
act->set_int_pos({ p->opos.X, p->opos.Y, p->opos.Z + gs.playerheight });
|
||||
act->set_int_pos({ p->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z + gs.playerheight });
|
||||
act->backupz();
|
||||
act->spr.ang = p->angle.oang.asbuild();
|
||||
SetActor(act, act->int_pos());
|
||||
|
@ -790,7 +790,7 @@ void movecrane(DDukeActor *actor, int crane)
|
|||
else if (actor->IsActiveCrane())
|
||||
{
|
||||
auto ang = ps[p].angle.ang.asbuild();
|
||||
ps[p].opos = ps[p].__int_pos;
|
||||
ps[p].__int_opos = ps[p].__int_pos;
|
||||
ps[p].__int_pos.X = actor->int_pos().X - bcos(ang, -6);
|
||||
ps[p].__int_pos.Y = actor->int_pos().Y - bsin(ang, -6);
|
||||
ps[p].__int_pos.Z = actor->int_pos().Z + (2 << 8);
|
||||
|
@ -2872,8 +2872,8 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
|
||||
}
|
||||
if (psp->spr.extra <= 0)
|
||||
{
|
||||
|
@ -2920,8 +2920,8 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &k);
|
||||
if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X = actor->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y = actor->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X = actor->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y = actor->int_pos().Y;
|
||||
ps[p].setCursector(actor->sector());
|
||||
|
||||
SetActor(ps[p].GetActor(), actor->int_pos());
|
||||
|
@ -3040,8 +3040,8 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
|
||||
}
|
||||
|
||||
ps[p].bobpos.X += l;
|
||||
|
@ -3085,8 +3085,8 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
|||
ps[p].__int_pos.X = actor->int_pos().X;
|
||||
ps[p].__int_pos.Y = actor->int_pos().Y;
|
||||
|
||||
ps[p].opos.X = ps[p].__int_pos.X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
|
||||
|
||||
ps[p].setCursector(actor->sector());
|
||||
|
||||
|
@ -3835,11 +3835,11 @@ void handle_se17(DDukeActor* actor)
|
|||
if (act1->spr.statnum == STAT_PLAYER && act1->GetOwner())
|
||||
{
|
||||
int p = act1->spr.yvel;
|
||||
if (numplayers < 2) ps[p].opos.Z = ps[p].__int_pos.Z;
|
||||
if (numplayers < 2) ps[p].__int_opos.Z = ps[p].__int_pos.Z;
|
||||
ps[p].__int_pos.Z += q * zworldtoint;
|
||||
ps[p].truefz += q;
|
||||
ps[p].truecz += q;
|
||||
if (numplayers > 1) ps[p].opos.Z = ps[p].__int_pos.Z;
|
||||
if (numplayers > 1) ps[p].__int_opos.Z = ps[p].__int_pos.Z;
|
||||
}
|
||||
if (act1->spr.statnum != STAT_EFFECTOR)
|
||||
{
|
||||
|
@ -3894,9 +3894,9 @@ void handle_se17(DDukeActor* actor)
|
|||
act3->floorz = act2->sector()->floorz;
|
||||
act3->ceilingz = act2->sector()->ceilingz;
|
||||
|
||||
ps[p].bobpos.X = ps[p].opos.X = ps[p].__int_pos.X;
|
||||
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z;
|
||||
ps[p].bobpos.X = ps[p].__int_opos.X = ps[p].__int_pos.X;
|
||||
ps[p].bobpos.Y = ps[p].__int_opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z;
|
||||
|
||||
ps[p].truefz = act3->floorz;
|
||||
ps[p].truecz = act3->ceilingz;
|
||||
|
@ -4184,8 +4184,8 @@ void handle_se20(DDukeActor* actor)
|
|||
ps[p].__int_pos.X += x;
|
||||
ps[p].__int_pos.Y += l;
|
||||
|
||||
ps[p].opos.X = ps[p].__int_pos.X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
|
||||
|
||||
SetActor(ps[p].GetActor(), { ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z + gs.playerheight });
|
||||
}
|
||||
|
@ -5239,8 +5239,8 @@ void movefta(void)
|
|||
{
|
||||
if (badguy(act))
|
||||
{
|
||||
px = ps[p].opos.X + 64 - (krand() & 127);
|
||||
py = ps[p].opos.Y + 64 - (krand() & 127);
|
||||
px = ps[p].__int_opos.X + 64 - (krand() & 127);
|
||||
py = ps[p].__int_opos.Y + 64 - (krand() & 127);
|
||||
updatesector(px, py, &psect);
|
||||
if (psect == nullptr)
|
||||
{
|
||||
|
@ -5261,14 +5261,14 @@ void movefta(void)
|
|||
{
|
||||
int r1 = krand();
|
||||
int r2 = krand();
|
||||
canseeme = cansee(sx, sy, act->int_pos().Z - (r2 % (52 << 8)), act->sector(), px, py, ps[p].opos.Z - (r1 % (32 << 8)), ps[p].cursector);
|
||||
canseeme = cansee(sx, sy, act->int_pos().Z - (r2 % (52 << 8)), act->sector(), px, py, ps[p].__int_opos.Z - (r1 % (32 << 8)), ps[p].cursector);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int r1 = krand();
|
||||
int r2 = krand();
|
||||
canseeme = cansee(act->int_pos().X, act->int_pos().Y, act->int_pos().Z - ((r2 & 31) << 8), act->sector(), ps[p].opos.X, ps[p].opos.Y, ps[p].opos.Z - ((r1 & 31) << 8), ps[p].cursector);
|
||||
canseeme = cansee(act->int_pos().X, act->int_pos().Y, act->int_pos().Z - ((r2 & 31) << 8), act->sector(), ps[p].__int_opos.X, ps[p].__int_opos.Y, ps[p].__int_opos.Z - ((r1 & 31) << 8), ps[p].cursector);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1806,9 +1806,9 @@ void movetransports_d(void)
|
|||
ps[p].transporter_hold = 13;
|
||||
}
|
||||
|
||||
ps[p].bobpos.X = ps[p].opos.X = ps[p].__int_pos.X = Owner->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - gs.playerheight;
|
||||
ps[p].bobpos.X = ps[p].__int_opos.X = ps[p].__int_pos.X = Owner->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].__int_opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - gs.playerheight;
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(act2->sector());
|
||||
|
@ -1828,13 +1828,13 @@ void movetransports_d(void)
|
|||
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) ||
|
||||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
|
||||
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
|
||||
ps[p].__int_pos.Z = Owner->int_pos().Z - 6144;
|
||||
else ps[p].__int_pos.Z = Owner->int_pos().Z + 6144;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z;
|
||||
|
||||
auto pa = ps[p].GetActor();
|
||||
pa->opos = DVector3(ps[p].__int_pos.X * inttoworld, ps[p].__int_pos.Y * inttoworld, ps[p].__int_pos.Z * zinttoworld);
|
||||
|
@ -1857,7 +1857,7 @@ void movetransports_d(void)
|
|||
}
|
||||
if (ps[p].GetActor()->spr.extra > 0)
|
||||
S_PlayActorSound(DUKE_UNDERWATER, act2);
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_ceilingz() + (7 << 8);
|
||||
|
||||
ps[p].vel.X = 4096 - (krand() & 8192);
|
||||
|
@ -1875,7 +1875,7 @@ void movetransports_d(void)
|
|||
}
|
||||
S_PlayActorSound(DUKE_GASP, act2);
|
||||
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_floorz() - (7 << 8);
|
||||
|
||||
ps[p].jumping_toggle = 1;
|
||||
|
@ -1884,8 +1884,8 @@ void movetransports_d(void)
|
|||
|
||||
if (k == 1)
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
|
||||
if (!Owner || Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -2183,7 +2183,7 @@ static void greenslime(DDukeActor *actor)
|
|||
if (ps[p].newOwner != nullptr)
|
||||
{
|
||||
ps[p].newOwner = nullptr;
|
||||
ps[p].__int_pos = ps[p].opos;
|
||||
ps[p].__int_pos = ps[p].__int_opos;
|
||||
ps[p].angle.restore();
|
||||
|
||||
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
|
||||
|
@ -3506,7 +3506,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->int_pos().X, ps[playernum].opos.Y - actor->int_pos().Y);
|
||||
goalang = getangle(ps[playernum].__int_opos.X - actor->int_pos().X, ps[playernum].__int_opos.Y - actor->int_pos().Y);
|
||||
else goalang = getangle(ps[playernum].__int_pos.X - actor->int_pos().X, ps[playernum].__int_pos.Y - actor->int_pos().Y);
|
||||
angdif = getincangle(actor->spr.ang, goalang) >> 2;
|
||||
if (angdif > -8 && angdif < 0) angdif = 0;
|
||||
|
@ -3519,7 +3519,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->int_pos().X, ps[playernum].opos.Y - actor->int_pos().Y);
|
||||
goalang = getangle(ps[playernum].__int_opos.X - actor->int_pos().X, ps[playernum].__int_opos.Y - actor->int_pos().Y);
|
||||
else goalang = getangle(ps[playernum].__int_pos.X - actor->int_pos().X, ps[playernum].__int_pos.Y - actor->int_pos().Y);
|
||||
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
|
||||
if (angdif > -32 && angdif < 0)
|
||||
|
|
|
@ -1456,9 +1456,9 @@ void movetransports_r(void)
|
|||
ps[p].transporter_hold = 13;
|
||||
}
|
||||
|
||||
ps[p].bobpos.X = ps[p].opos.X = ps[p].__int_pos.X = Owner->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - (gs.playerheight - (4 << 8));
|
||||
ps[p].bobpos.X = ps[p].__int_opos.X = ps[p].__int_pos.X = Owner->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].__int_opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - (gs.playerheight - (4 << 8));
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(act2->sector());
|
||||
|
@ -1475,13 +1475,13 @@ void movetransports_r(void)
|
|||
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) ||
|
||||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
|
||||
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
|
||||
ps[p].__int_pos.Z = Owner->int_pos().Z - 6144;
|
||||
else ps[p].__int_pos.Z = Owner->int_pos().Z + 6144;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z;
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(Owner->sector());
|
||||
|
@ -1496,7 +1496,7 @@ void movetransports_r(void)
|
|||
if (onfloorz && sectlotag == 160 && ps[p].__int_pos.Z > (sectp->int_floorz() - (48 << 8)))
|
||||
{
|
||||
k = 2;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_ceilingz() + (7 << 8);
|
||||
}
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ void movetransports_r(void)
|
|||
{
|
||||
k = 2;
|
||||
if (ps[p].GetActor()->spr.extra <= 0) break;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_floorz() - (49 << 8);
|
||||
}
|
||||
}
|
||||
|
@ -1519,7 +1519,7 @@ void movetransports_r(void)
|
|||
FX_StopAllSounds();
|
||||
}
|
||||
S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor());
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_ceilingz() + (7 << 8);
|
||||
if (ps[p].OnMotorcycle)
|
||||
ps[p].moto_underwater = 1;
|
||||
|
@ -1535,14 +1535,14 @@ void movetransports_r(void)
|
|||
}
|
||||
S_PlayActorSound(DUKE_GASP, ps[p].GetActor());
|
||||
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z =
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
|
||||
Owner->sector()->int_floorz() - (7 << 8);
|
||||
}
|
||||
|
||||
if (k == 1)
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -1555,8 +1555,8 @@ void movetransports_r(void)
|
|||
}
|
||||
else if (isRRRA() && k == 2)
|
||||
{
|
||||
ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
ps[p].__int_opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
|
||||
ps[p].__int_opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -2289,9 +2289,9 @@ void rr_specialstats()
|
|||
if (act2->spr.picnum == RRTILE297)
|
||||
{
|
||||
ps[p].angle.ang = buildang(act2->spr.ang);
|
||||
ps[p].bobpos.X = ps[p].opos.X = ps[p].__int_pos.X = act2->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = act2->int_pos().Y;
|
||||
ps[p].opos.Z = ps[p].__int_pos.Z = act2->int_pos().Z - (36 << 8);
|
||||
ps[p].bobpos.X = ps[p].__int_opos.X = ps[p].__int_pos.X = act2->int_pos().X;
|
||||
ps[p].bobpos.Y = ps[p].__int_opos.Y = ps[p].__int_pos.Y = act2->int_pos().Y;
|
||||
ps[p].__int_opos.Z = ps[p].__int_pos.Z = act2->int_pos().Z - (36 << 8);
|
||||
auto pact = ps[p].GetActor();
|
||||
ChangeActorSect(pact, act2->sector());
|
||||
ps[p].setCursector(pact->sector());
|
||||
|
@ -3488,7 +3488,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->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y);
|
||||
goalang = getangle(ps[pnum].__int_opos.X - actor->int_pos().X, ps[pnum].__int_opos.Y - actor->int_pos().Y);
|
||||
else goalang = getangle(ps[pnum].__int_pos.X - actor->int_pos().X, ps[pnum].__int_pos.Y - actor->int_pos().Y);
|
||||
angdif = getincangle(actor->spr.ang, goalang) >> 2;
|
||||
if (angdif > -8 && angdif < 0) angdif = 0;
|
||||
|
@ -3501,7 +3501,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->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y);
|
||||
goalang = getangle(ps[pnum].__int_opos.X - actor->int_pos().X, ps[pnum].__int_opos.Y - actor->int_pos().Y);
|
||||
else goalang = getangle(ps[pnum].__int_pos.X - actor->int_pos().X, ps[pnum].__int_pos.Y - actor->int_pos().Y);
|
||||
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
|
||||
if (angdif > -32 && angdif < 0)
|
||||
|
@ -3517,7 +3517,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->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y) + 1024) & 2047;
|
||||
goalang = (getangle(ps[pnum].__int_opos.X - actor->int_pos().X, ps[pnum].__int_opos.Y - actor->int_pos().Y) + 1024) & 2047;
|
||||
else goalang = (getangle(ps[pnum].__int_pos.X - actor->int_pos().X, ps[pnum].__int_pos.Y - actor->int_pos().Y) + 1024) & 2047;
|
||||
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
|
||||
if (angdif > -32 && angdif < 0)
|
||||
|
|
|
@ -165,9 +165,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
if (t->statnum == 99) continue;
|
||||
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner())
|
||||
{
|
||||
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.X - ps[h->spr.yvel].opos.X, 16));
|
||||
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.Y - ps[h->spr.yvel].opos.Y, 16));
|
||||
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
|
||||
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.X - ps[h->spr.yvel].__int_opos.X, 16));
|
||||
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.Y - ps[h->spr.yvel].__int_opos.Y, 16));
|
||||
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].__int_opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
|
||||
t->add_int_z(PHEIGHT_DUKE);
|
||||
}
|
||||
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
||||
|
|
|
@ -145,9 +145,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
if (t->statnum == 99) continue;
|
||||
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner())
|
||||
{
|
||||
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.X - ps[h->spr.yvel].opos.X, 16));
|
||||
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.Y - ps[h->spr.yvel].opos.Y, 16));
|
||||
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
|
||||
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.X - ps[h->spr.yvel].__int_opos.X, 16));
|
||||
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.Y - ps[h->spr.yvel].__int_opos.Y, 16));
|
||||
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].__int_opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
|
||||
t->add_int_z(PHEIGHT_RR);
|
||||
h->spr.xrepeat = 24;
|
||||
h->spr.yrepeat = 17;
|
||||
|
|
|
@ -115,9 +115,9 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
|||
{
|
||||
player_struct* p = &ps[myconnectindex];
|
||||
|
||||
p->opos.X = p->__int_pos.X = x;
|
||||
p->opos.Y = p->__int_pos.Y = y;
|
||||
p->opos.Z = p->__int_pos.Z = z;
|
||||
p->__int_opos.X = p->__int_pos.X = x;
|
||||
p->__int_opos.Y = p->__int_pos.Y = y;
|
||||
p->__int_opos.Z = p->__int_pos.Z = z;
|
||||
|
||||
if (ang != INT_MIN)
|
||||
{
|
||||
|
|
|
@ -279,15 +279,15 @@ void drawoverlays(double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
cposx = interpolatedvalue(pp->opos.X, pp->__int_pos.X, smoothratio);
|
||||
cposy = interpolatedvalue(pp->opos.Y, pp->__int_pos.Y, smoothratio);
|
||||
cposx = interpolatedvalue(pp->__int_opos.X, pp->__int_pos.X, smoothratio);
|
||||
cposy = interpolatedvalue(pp->__int_opos.Y, pp->__int_pos.Y, smoothratio);
|
||||
cang = (!SyncInput() ? pp->angle.ang : interpolatedangle(pp->angle.oang, pp->angle.ang, smoothratio)).asbuild();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cposx = pp->opos.X;
|
||||
cposy = pp->opos.Y;
|
||||
cposx = pp->__int_opos.X;
|
||||
cposy = pp->__int_opos.Y;
|
||||
cang = pp->angle.oang.asbuild();
|
||||
}
|
||||
DrawOverheadMap(cposx, cposy, cang, smoothratio);
|
||||
|
|
|
@ -378,18 +378,18 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
break;
|
||||
|
||||
case PLAYER_OPOSX:
|
||||
if (bSet) ps[iPlayer].opos.X = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].opos.X, sActor, sPlayer);
|
||||
if (bSet) ps[iPlayer].__int_opos.X = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.X, sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_OPOSY:
|
||||
if (bSet) ps[iPlayer].opos.Y = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].opos.Y, sActor, sPlayer);
|
||||
if (bSet) ps[iPlayer].__int_opos.Y = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.Y, sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_OPOSZ:
|
||||
if (bSet) ps[iPlayer].opos.Z = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].opos.Z, sActor, sPlayer);
|
||||
if (bSet) ps[iPlayer].__int_opos.Z = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.Z, sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_PYOFF:
|
||||
|
@ -2047,9 +2047,9 @@ int ParseState::parse(void)
|
|||
if(!isRR() && ps[g_p].newOwner != nullptr)
|
||||
{
|
||||
ps[g_p].newOwner = nullptr;
|
||||
ps[g_p].__int_pos.X = ps[g_p].opos.X;
|
||||
ps[g_p].__int_pos.Y = ps[g_p].opos.Y;
|
||||
ps[g_p].__int_pos.Z = ps[g_p].opos.Z;
|
||||
ps[g_p].__int_pos.X = ps[g_p].__int_opos.X;
|
||||
ps[g_p].__int_pos.Y = ps[g_p].__int_opos.Y;
|
||||
ps[g_p].__int_pos.Z = ps[g_p].__int_opos.Z;
|
||||
ps[g_p].angle.restore();
|
||||
updatesector(ps[g_p].__int_pos.X,ps[g_p].__int_pos.Y,&ps[g_p].cursector);
|
||||
|
||||
|
@ -2226,7 +2226,7 @@ int ParseState::parse(void)
|
|||
{
|
||||
// I am not convinced this is even remotely smart to be executed from here..
|
||||
pickrandomspot(g_p);
|
||||
g_ac->set_int_pos({ ps[g_p].bobpos.X = ps[g_p].opos.X = ps[g_p].__int_pos.X, ps[g_p].bobpos.Y = ps[g_p].opos.Y = ps[g_p].__int_pos.Y, ps[g_p].opos.Z = ps[g_p].__int_pos.Z });
|
||||
g_ac->set_int_pos({ ps[g_p].bobpos.X = ps[g_p].__int_opos.X = ps[g_p].__int_pos.X, ps[g_p].bobpos.Y = ps[g_p].__int_opos.Y = ps[g_p].__int_pos.Y, ps[g_p].__int_opos.Z = ps[g_p].__int_pos.Z });
|
||||
g_ac->backuppos();
|
||||
updatesector(ps[g_p].__int_pos.X, ps[g_p].__int_pos.Y, &ps[g_p].cursector);
|
||||
SetActor(ps[g_p].GetActor(), { ps[g_p].__int_pos.X, ps[g_p].__int_pos.Y, ps[g_p].__int_pos.Z + gs.playerheight });
|
||||
|
|
|
@ -769,16 +769,16 @@ void player_struct::backuppos(bool noclipping)
|
|||
{
|
||||
if (!noclipping)
|
||||
{
|
||||
opos.X = __int_pos.X;
|
||||
opos.Y = __int_pos.Y;
|
||||
__int_opos.X = __int_pos.X;
|
||||
__int_opos.Y = __int_pos.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
__int_pos.X = opos.X;
|
||||
__int_pos.Y = opos.Y;
|
||||
__int_pos.X = __int_opos.X;
|
||||
__int_pos.Y = __int_opos.Y;
|
||||
}
|
||||
|
||||
opos.Z = __int_pos.Z;
|
||||
__int_opos.Z = __int_pos.Z;
|
||||
bobpos.X = __int_pos.X;
|
||||
bobpos.Y = __int_pos.Y;
|
||||
opyoff = pyoff;
|
||||
|
|
|
@ -107,7 +107,7 @@ static void shootfireball(DDukeActor *actor, int p, int sx, int sy, int sz, int
|
|||
sa += 16 - (krand() & 31);
|
||||
int scratch;
|
||||
int j = findplayer(actor, &scratch);
|
||||
zvel = (((ps[j].opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
zvel = (((ps[j].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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].opos.Y - sy);
|
||||
sa = getangle(ps[j].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
|
||||
|
||||
if (actor->spr.picnum == BOSS5)
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
|
|||
|
||||
int l = ldist(ps[j].GetActor(), actor);
|
||||
if (l != 0)
|
||||
zvel = ((ps[j].opos.Z - sz) * vel) / l;
|
||||
zvel = ((ps[j].__int_opos.Z - sz) * vel) / l;
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0)
|
||||
sa = (short)(actor->spr.ang + (krand() & 31) - 16);
|
||||
|
@ -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].opos.Y) - sa) - 1024)))
|
||||
- abs(abs(getangle(sx - ps[p].__int_opos.X, sy - ps[p].__int_opos.Y) - sa) - 1024)))
|
||||
* 0.001953125f) * ps[p].GetActor()->spr.xvel) + 400);
|
||||
if (actor->sector()->lotag == 2 && (krand() % 5) == 0)
|
||||
spawned = spawn(actor, WATERBUBBLE);
|
||||
|
@ -604,7 +604,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
int j = findplayer(actor, &x);
|
||||
// sa = getangle(ps[j].oposx-sx,ps[j].oposy-sy);
|
||||
sa += 16 - (krand() & 31);
|
||||
zvel = (((ps[j].opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
zvel = (((ps[j].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
}
|
||||
|
||||
int oldzvel = zvel;
|
||||
|
@ -703,7 +703,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].opos.Y - sy);
|
||||
sa = getangle(ps[j].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
|
||||
if (actor->spr.picnum == BOSS3)
|
||||
{
|
||||
int zoffs = (32 << 8);
|
||||
|
@ -721,7 +721,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
}
|
||||
|
||||
l = ldist(ps[j].GetActor(), actor);
|
||||
zvel = ((ps[j].opos.Z - sz) * vel) / l;
|
||||
zvel = ((ps[j].__int_opos.Z - sz) * vel) / l;
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
|
||||
sa = actor->spr.ang + (krand() & 31) - 16;
|
||||
|
@ -1148,7 +1148,7 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
{
|
||||
j = findplayer(actor, &x);
|
||||
l = ldist(ps[j].GetActor(), actor);
|
||||
zvel = ((ps[j].opos.Z - sz) * 512) / l;
|
||||
zvel = ((ps[j].__int_opos.Z - sz) * 512) / l;
|
||||
}
|
||||
else zvel = 0;
|
||||
|
||||
|
@ -2034,7 +2034,7 @@ int operateTripbomb(int snum)
|
|||
if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2))
|
||||
if (((hit.hitpos.X - p->__int_pos.X) * (hit.hitpos.X - p->__int_pos.X) + (hit.hitpos.Y - p->__int_pos.Y) * (hit.hitpos.Y - p->__int_pos.Y)) < (290 * 290))
|
||||
{
|
||||
p->__int_pos.Z = p->opos.Z;
|
||||
p->__int_pos.Z = p->__int_opos.Z;
|
||||
p->vel.Z = 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -2572,7 +2572,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
case TRIPBOMB_WEAPON: // Claymore in NAM
|
||||
if (p->kickback_pic < 4)
|
||||
{
|
||||
p->__int_pos.Z = p->opos.Z;
|
||||
p->__int_pos.Z = p->__int_opos.Z;
|
||||
p->vel.Z = 0;
|
||||
if (p->kickback_pic == 3)
|
||||
fi.shoot(pact, HANDHOLDINGLASER);
|
||||
|
@ -2848,7 +2848,7 @@ void processinput_d(int snum)
|
|||
|
||||
checklook(snum,actions);
|
||||
int ii = 40;
|
||||
auto oldpos = p->opos;
|
||||
auto oldpos = p->__int_opos;
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
goto HORIZONLY;
|
||||
|
@ -3094,7 +3094,7 @@ HORIZONLY:
|
|||
{
|
||||
if (!retry++)
|
||||
{
|
||||
p->__int_pos = p->opos = oldpos;
|
||||
p->__int_pos = p->__int_opos = oldpos;
|
||||
continue;
|
||||
}
|
||||
quickkill(p);
|
||||
|
|
|
@ -529,7 +529,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
else if (actor->spr.picnum != UFOBEAM)
|
||||
sa += 16 - (krand() & 31);
|
||||
|
||||
zvel = (((ps[j].opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
zvel = (((ps[j].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
}
|
||||
|
||||
int oldzvel = zvel;
|
||||
|
@ -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].opos.Y - sy);
|
||||
sa = getangle(ps[j].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
|
||||
if (actor->spr.picnum == BOSS3)
|
||||
sz -= (32 << 8);
|
||||
else if (actor->spr.picnum == BOSS2)
|
||||
|
@ -654,7 +654,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
}
|
||||
|
||||
l = ldist(ps[j].GetActor(), actor);
|
||||
zvel = ((ps[j].opos.Z - sz) * vel) / l;
|
||||
zvel = ((ps[j].__int_opos.Z - sz) * vel) / l;
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
|
||||
sa = actor->spr.ang + (krand() & 31) - 16;
|
||||
|
@ -791,7 +791,7 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
sa -= (krand() & 16);
|
||||
else
|
||||
sa += 16 - (krand() & 31);
|
||||
zvel = (((ps[j].opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
zvel = (((ps[j].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
|
||||
}
|
||||
|
||||
int oldzvel = zvel;
|
||||
|
@ -3573,7 +3573,7 @@ void processinput_r(int snum)
|
|||
checklook(snum, actions);
|
||||
p->apply_seasick(1);
|
||||
|
||||
auto oldpos = p->opos;
|
||||
auto oldpos = p->__int_opos;
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
goto HORIZONLY;
|
||||
|
@ -3947,7 +3947,7 @@ HORIZONLY:
|
|||
{
|
||||
if (!retry++)
|
||||
{
|
||||
p->__int_pos = p->opos = oldpos;
|
||||
p->__int_pos = p->__int_opos = oldpos;
|
||||
continue;
|
||||
}
|
||||
quickkill(p);
|
||||
|
|
|
@ -439,7 +439,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL
|
||||
&& p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1))
|
||||
{
|
||||
p->__int_pos.Z = p->opos.Z;
|
||||
p->__int_pos.Z = p->__int_opos.Z;
|
||||
p->vel.Z = 0;
|
||||
}
|
||||
if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum))
|
||||
|
|
|
@ -95,9 +95,9 @@ void pickrandomspot(int snum)
|
|||
i = krand()%numplayersprites;
|
||||
else i = snum;
|
||||
|
||||
p->bobpos.X = p->opos.X = p->__int_pos.X = po[i].opos.X;
|
||||
p->bobpos.Y = p->opos.Y = p->__int_pos.Y = po[i].opos.Y;
|
||||
p->opos.Z = p->__int_pos.Z = po[i].opos.Z;
|
||||
p->bobpos.X = p->__int_opos.X = p->__int_pos.X = po[i].opos.X;
|
||||
p->bobpos.Y = p->__int_opos.Y = p->__int_pos.Y = po[i].opos.Y;
|
||||
p->__int_opos.Z = p->__int_pos.Z = po[i].opos.Z;
|
||||
p->angle.oang = p->angle.ang = buildang(po[i].oa);
|
||||
p->setCursector(po[i].os);
|
||||
}
|
||||
|
@ -659,9 +659,9 @@ void resetpspritevars(int g)
|
|||
ps[j].frag_ps = j;
|
||||
act->SetOwner(act);
|
||||
|
||||
ps[j].bobpos.X = ps[j].opos.X = ps[j].__int_pos.X = act->int_pos().X;
|
||||
ps[j].bobpos.Y = ps[j].opos.Y = ps[j].__int_pos.Y = act->int_pos().Y;
|
||||
ps[j].opos.Z = ps[j].__int_pos.Z = act->int_pos().Z;
|
||||
ps[j].bobpos.X = ps[j].__int_opos.X = ps[j].__int_pos.X = act->int_pos().X;
|
||||
ps[j].bobpos.Y = ps[j].__int_opos.Y = ps[j].__int_pos.Y = act->int_pos().Y;
|
||||
ps[j].__int_opos.Z = ps[j].__int_pos.Z = act->int_pos().Z;
|
||||
act->backuppos();
|
||||
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang);
|
||||
|
||||
|
|
|
@ -305,9 +305,9 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
|
|||
else
|
||||
#endif
|
||||
{
|
||||
cposx = interpolatedvalue(p->opos.X, p->__int_pos.X, smoothratio);
|
||||
cposy = interpolatedvalue(p->opos.Y, p->__int_pos.Y, smoothratio);
|
||||
cposz = interpolatedvalue(p->opos.Z, p->__int_pos.Z, smoothratio);;
|
||||
cposx = interpolatedvalue(p->__int_opos.X, p->__int_pos.X, smoothratio);
|
||||
cposy = interpolatedvalue(p->__int_opos.Y, p->__int_pos.Y, smoothratio);
|
||||
cposz = interpolatedvalue(p->__int_opos.Z, p->__int_pos.Z, smoothratio);;
|
||||
if (SyncInput())
|
||||
{
|
||||
// Original code for when the values are passed through the sync struct
|
||||
|
|
|
@ -277,9 +277,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
|||
.EndObject();
|
||||
|
||||
w.invdisptime = 0;
|
||||
w.opos.X = w.__int_pos.X;
|
||||
w.opos.Y = w.__int_pos.Y;
|
||||
w.opos.Z = w.__int_pos.Z;
|
||||
w.__int_opos.X = w.__int_pos.X;
|
||||
w.__int_opos.Y = w.__int_pos.Y;
|
||||
w.__int_opos.Z = w.__int_pos.Z;
|
||||
w.opyoff = w.pyoff;
|
||||
w.backupweapon();
|
||||
w.sync.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
|
||||
|
|
|
@ -227,7 +227,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].opos.Y - s.Y) + ((abs(ps[myconnectindex].opos.Z - s.Z + (28 << 8))) >> 4);
|
||||
if (d) *d = abs(ps[myconnectindex].__int_opos.X - s.X) + abs(ps[myconnectindex].__int_opos.Y - s.Y) + ((abs(ps[myconnectindex].__int_opos.Z - s.Z + (28 << 8))) >> 4);
|
||||
return myconnectindex;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,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].opos.Y - s.Y) + ((abs(ps[j].opos.Z - s.Z + (28 << 8))) >> 4);
|
||||
x = abs(ps[j].__int_opos.X - s.X) + abs(ps[j].__int_opos.Y - s.Y) + ((abs(ps[j].__int_opos.Z - s.Z + (28 << 8))) >> 4);
|
||||
if (x < closest && ps[j].GetActor()->spr.extra > 0)
|
||||
{
|
||||
closest_player = j;
|
||||
|
@ -265,7 +265,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].__int_pos.X) + abs(ps[j].opos.Y - ps[p].__int_pos.Y) + (abs(ps[j].opos.Z - ps[p].__int_pos.Z) >> 4);
|
||||
x = abs(ps[j].__int_opos.X - ps[p].__int_pos.X) + abs(ps[j].__int_opos.Y - ps[p].__int_pos.Y) + (abs(ps[j].__int_opos.Z - ps[p].__int_pos.Z) >> 4);
|
||||
|
||||
if (x < closest)
|
||||
{
|
||||
|
|
|
@ -1441,9 +1441,9 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (ps[p].newOwner != nullptr)
|
||||
{
|
||||
ps[p].newOwner = nullptr;
|
||||
ps[p].__int_pos.X = ps[p].opos.X;
|
||||
ps[p].__int_pos.Y = ps[p].opos.Y;
|
||||
ps[p].__int_pos.Z = ps[p].opos.Z;
|
||||
ps[p].__int_pos.X = ps[p].__int_opos.X;
|
||||
ps[p].__int_pos.Y = ps[p].__int_opos.Y;
|
||||
ps[p].__int_pos.Z = ps[p].__int_opos.Z;
|
||||
ps[p].angle.restore();
|
||||
|
||||
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
|
||||
|
@ -1479,9 +1479,9 @@ void clearcameras(int i, player_struct* p)
|
|||
{
|
||||
if (i < 0)
|
||||
{
|
||||
p->__int_pos.X = p->opos.X;
|
||||
p->__int_pos.Y = p->opos.Y;
|
||||
p->__int_pos.Z = p->opos.Z;
|
||||
p->__int_pos.X = p->__int_opos.X;
|
||||
p->__int_pos.Y = p->__int_opos.Y;
|
||||
p->__int_pos.Z = p->__int_opos.Z;
|
||||
p->newOwner = nullptr;
|
||||
|
||||
updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
|
||||
|
@ -1593,7 +1593,7 @@ void checksectors_d(int snum)
|
|||
return;
|
||||
}
|
||||
if (p->newOwner != nullptr)
|
||||
neartag({ p->opos.X, p->opos.Y, p->opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
|
||||
neartag({ p->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
|
||||
else
|
||||
{
|
||||
neartag(p->__int_pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
|
||||
|
|
|
@ -2373,9 +2373,9 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (ps[p].newOwner != nullptr)
|
||||
{
|
||||
ps[p].newOwner = nullptr;
|
||||
ps[p].__int_pos.X = ps[p].opos.X;
|
||||
ps[p].__int_pos.Y = ps[p].opos.Y;
|
||||
ps[p].__int_pos.Z = ps[p].opos.Z;
|
||||
ps[p].__int_pos.X = ps[p].__int_opos.X;
|
||||
ps[p].__int_pos.Y = ps[p].__int_opos.Y;
|
||||
ps[p].__int_pos.Z = ps[p].__int_opos.Z;
|
||||
|
||||
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
|
||||
|
||||
|
@ -2530,7 +2530,7 @@ void checksectors_r(int snum)
|
|||
}
|
||||
|
||||
if (p->newOwner != nullptr)
|
||||
neartag({ p->opos.X, p->opos.Y, p->opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
|
||||
neartag({ p->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
|
||||
else
|
||||
{
|
||||
neartag(p->__int_pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
|
||||
|
|
|
@ -206,7 +206,7 @@ struct player_struct
|
|||
// This is basically the version from JFDuke but this first block contains a few changes to make it work with other parts of Raze.
|
||||
|
||||
// The sound code wants to read a vector out of this so we need to define one for the main coordinate.
|
||||
vec3_t __int_pos, opos, vel;
|
||||
vec3_t __int_pos, __int_opos, vel;
|
||||
|
||||
// player's horizon and angle structs.
|
||||
PlayerHorizon horizon;
|
||||
|
|
|
@ -397,9 +397,11 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backuppos, dukeplayer_backuppos)
|
|||
|
||||
void dukeplayer_setpos(player_struct* self, double x, double y, double z)
|
||||
{
|
||||
/*
|
||||
self->pos.X = int(x * worldtoint);
|
||||
self->pos.Y = int(y * worldtoint);
|
||||
self->pos.Z = int(z * zworldtoint);
|
||||
*/
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, setpos, dukeplayer_setpos)
|
||||
|
|
Loading…
Reference in a new issue