- use wrapper functions for pos/opos where possible.

This commit is contained in:
Christoph Oelckers 2022-02-04 18:11:44 +01:00
parent 591dcc995a
commit 312ee075d2
23 changed files with 297 additions and 285 deletions

View file

@ -204,7 +204,7 @@ void clearcamera(player_struct* ps)
ps->newOwner = nullptr;
ps->__int_pos = ps->__int_opos;
ps->angle.restore();
updatesector(ps->__int_pos.X, ps->__int_pos.Y, &ps->cursector);
updatesector(ps->player_int_pos().X, ps->player_int_pos().Y, &ps->cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto k = it.Next())
@ -372,7 +372,7 @@ void movedummyplayers(void)
}
}
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 });
act->add_int_pos({ (ps[p].player_int_pos().X - ps[p].__int_opos.X), (ps[p].player_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->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z + gs.int_playerheight });
act->set_int_pos({ p->player_int_opos().X, p->player_int_opos().Y, p->player_int_opos().Z + gs.int_playerheight });
act->backupz();
act->spr.ang = p->angle.oang.asbuild();
SetActor(act, act->int_pos());
@ -440,7 +440,7 @@ void moveplayers(void)
if (p->actorsqu != nullptr)
{
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->actorsqu->int_pos().X - p->__int_pos.X, p->actorsqu->int_pos().Y - p->__int_pos.Y)) >> 2);
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->actorsqu->int_pos().X - p->player_int_pos().X, p->actorsqu->int_pos().Y - p->player_int_pos().Y)) >> 2);
}
if (act->spr.extra > 0)
@ -463,7 +463,7 @@ void moveplayers(void)
if (p->wackedbyactor != nullptr && p->wackedbyactor->spr.statnum < MAXSTATUS)
{
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->wackedbyactor->int_pos().X - p->__int_pos.X, p->wackedbyactor->int_pos().Y - p->__int_pos.Y)) >> 1);
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->wackedbyactor->int_pos().X - p->player_int_pos().X, p->wackedbyactor->int_pos().Y - p->player_int_pos().Y)) >> 1);
}
}
act->spr.ang = p->angle.ang.asbuild();
@ -1500,7 +1500,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{
// if(actor->spr.pal == 12)
{
int j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y));
int j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].player_int_pos().X, actor->int_pos().Y - ps[p].player_int_pos().Y));
if (j > -64 && j < 64 && PlayerInput(p, SB_OPEN))
if (ps[p].toggle_key_flag == 1)
{
@ -1510,7 +1510,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{
if (act2->spr.picnum == queball || act2->spr.picnum == stripeball)
{
j = getincangle(ps[p].angle.ang.asbuild(), getangle(act2->int_pos().X - ps[p].__int_pos.X, act2->int_pos().Y - ps[p].__int_pos.Y));
j = getincangle(ps[p].angle.ang.asbuild(), getangle(act2->int_pos().X - ps[p].player_int_pos().X, act2->int_pos().Y - ps[p].player_int_pos().Y));
if (j > -64 && j < 64)
{
int l;
@ -1532,7 +1532,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
}
if (x < 512 && actor->sector() == ps[p].cursector)
{
actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
actor->spr.ang = getangle(actor->int_pos().X - ps[p].player_int_pos().X, actor->int_pos().Y - ps[p].player_int_pos().Y);
actor->spr.xvel = 48;
}
}
@ -1678,13 +1678,13 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
fi.shoot(actor, firelaser);
actor->spr.ang = a;
}
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector(), ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector(), ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z, ps[p].cursector))
{
actor->temp_data[0] = 0;
actor->temp_data[2] = 0;
}
else actor->tempang +=
getincangle(actor->tempang, getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) / 3;
getincangle(actor->tempang, getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y)) / 3;
}
else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 3)
{
@ -1694,14 +1694,14 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
if (actor->temp_data[0] == 2)
{
int l = ps[p].__int_pos.Z - actor->int_pos().Z;
int l = ps[p].player_int_pos().Z - actor->int_pos().Z;
if (abs(l) < (48 << 8)) actor->temp_data[0] = 3;
else actor->add_int_z(Sgn(ps[p].__int_pos.Z - actor->int_pos().Z) << shift); // The shift here differs between Duke and RR.
else actor->add_int_z(Sgn(ps[p].player_int_pos().Z - actor->int_pos().Z) << shift); // The shift here differs between Duke and RR.
}
else
{
actor->temp_data[2]++;
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector(), ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector(), ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z, ps[p].cursector))
{
actor->temp_data[0] = 1;
actor->temp_data[2] = 0;
@ -1712,7 +1712,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
fi.shoot(actor, firelaser);
}
}
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) >> 2;
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y)) >> 2;
}
if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner)
@ -2687,8 +2687,8 @@ void handle_se00(DDukeActor* actor)
vec2_t res;
rotatepoint(Owner->int_pos().vec2, ps[p].__int_pos.vec2, (q * l), &res);
ps[p].bobpos.X += res.X - ps[p].__int_pos.X;
ps[p].bobpos.Y += res.Y - ps[p].__int_pos.Y;
ps[p].bobpos.X += res.X - ps[p].player_int_pos().X;
ps[p].bobpos.Y += res.Y - ps[p].player_int_pos().Y;
ps[p].__int_pos.vec2 = res;
@ -2811,7 +2811,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (x < 20480)
{
j = actor->spr.ang;
actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
actor->spr.ang = getangle(actor->int_pos().X - ps[p].player_int_pos().X, actor->int_pos().Y - ps[p].player_int_pos().Y);
fi.shoot(actor, RPG);
actor->spr.ang = j;
}
@ -2830,7 +2830,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (psp->spr.extra > 0)
{
auto k = ps[p].cursector;
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &k);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &k);
if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{
ps[p].__int_pos.X = actor->int_pos().X;
@ -2863,7 +2863,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
rotatepoint(actor->int_pos().vec2, ps[p].__int_pos.vec2, q, &ps[p].__int_pos.vec2);
ps[p].__int_pos.X += m;
ps[p].__int_pos.Y += x;
ps[p].__int_pos.Y +=x;
ps[p].bobpos.X += m;
ps[p].bobpos.Y += x;
@ -2872,12 +2872,12 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (numplayers > 1)
{
ps[p].__int_opos.X = ps[p].__int_pos.X;
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
ps[p].__int_opos.X = ps[p].player_int_pos().X;
ps[p].__int_opos.Y = ps[p].player_int_pos().Y;
}
if (psp->spr.extra <= 0)
{
psp->set_int_xy(ps[p].__int_pos.X, ps[p].__int_pos.Y);
psp->set_int_xy(ps[p].player_int_pos().X, ps[p].player_int_pos().Y);
}
}
}
@ -2917,7 +2917,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (ps[p].GetActor()->spr.extra > 0)
{
auto k = ps[p].cursector;
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &k);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &k);
if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{
ps[p].__int_opos.X = ps[p].__int_pos.X = actor->int_pos().X;
@ -3018,7 +3018,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (psp->spr.extra > 0)
{
auto k = ps[p].cursector;
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &k);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &k);
if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{
ps[p].__int_pos.X = actor->int_pos().X;
@ -3036,12 +3036,12 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (psp->sector() == actor->sector())
{
ps[p].__int_pos.X += l;
ps[p].__int_pos.Y += x;
ps[p].__int_pos.Y +=x;
if (numplayers > 1)
{
ps[p].__int_opos.X = ps[p].__int_pos.X;
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
ps[p].__int_opos.X = ps[p].player_int_pos().X;
ps[p].__int_opos.Y = ps[p].player_int_pos().Y;
}
ps[p].bobpos.X += l;
@ -3079,14 +3079,14 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (ps[p].GetActor()->spr.extra > 0)
{
auto k = ps[p].cursector;
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &k);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &k);
if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{
ps[p].__int_pos.X = actor->int_pos().X;
ps[p].__int_pos.Y = actor->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].__int_opos.X = ps[p].player_int_pos().X;
ps[p].__int_opos.Y = ps[p].player_int_pos().Y;
ps[p].setCursector(actor->sector());
@ -3172,7 +3172,7 @@ void handle_se02(DDukeActor* actor)
if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{
ps[p].__int_pos.X += m;
ps[p].__int_pos.Y += x;
ps[p].__int_pos.Y +=x;
ps[p].bobpos.X += m;
ps[p].bobpos.Y += x;
@ -3323,7 +3323,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
if (x < 8192)
{
j = actor->spr.ang;
actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
actor->spr.ang = getangle(actor->int_pos().X - ps[p].player_int_pos().X, actor->int_pos().Y - ps[p].player_int_pos().Y);
fi.shoot(actor, FIRELASER);
actor->spr.ang = j;
}
@ -3357,7 +3357,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
if (ldist(Owner, actor) < 1024)
{
auto ta = actor->spr.ang;
actor->spr.ang = getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y);
actor->spr.ang = getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y);
actor->spr.ang = ta;
actor->SetOwner(nullptr);
return;
@ -3377,7 +3377,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
else
{
actor->temp_data[2] +=
getincangle(actor->temp_data[2] + 512, getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) >> 2;
getincangle(actor->temp_data[2] + 512, getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y)) >> 2;
sc->ceilingshade = 0;
}
j = fi.ifhitbyweapon(actor);
@ -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].__int_opos.Z = ps[p].__int_pos.Z;
if (numplayers < 2) ps[p].__int_opos.Z = ps[p].player_int_pos().Z;
ps[p].__int_pos.Z += q * zworldtoint;
ps[p].truefz += q;
ps[p].truecz += q;
if (numplayers > 1) ps[p].__int_opos.Z = ps[p].__int_pos.Z;
if (numplayers > 1) ps[p].__int_opos.Z = ps[p].player_int_pos().Z;
}
if (act1->spr.statnum != STAT_EFFECTOR)
{
@ -3888,15 +3888,15 @@ void handle_se17(DDukeActor* actor)
int p = act3->spr.yvel;
ps[p].__int_pos.X += act2->int_pos().X - actor->int_pos().X;
ps[p].__int_pos.Y += act2->int_pos().Y - actor->int_pos().Y;
ps[p].__int_pos.Z = act2->sector()->int_floorz() - (sc->int_floorz() - ps[p].__int_pos.Z);
ps[p].__int_pos.Y +=act2->int_pos().Y - actor->int_pos().Y;
ps[p].__int_pos.Z = act2->sector()->int_floorz() - (sc->int_floorz() - ps[p].player_int_pos().Z);
act3->floorz = act2->sector()->floorz;
act3->ceilingz = act2->sector()->ceilingz;
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].bobpos.X = ps[p].__int_opos.X = ps[p].player_int_pos().X;
ps[p].bobpos.Y = ps[p].__int_opos.Y = ps[p].player_int_pos().Y;
ps[p].__int_opos.Z = ps[p].player_int_pos().Z;
ps[p].truefz = act3->floorz;
ps[p].truecz = act3->ceilingz;
@ -4182,12 +4182,12 @@ void handle_se20(DDukeActor* actor)
if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{
ps[p].__int_pos.X += x;
ps[p].__int_pos.Y += l;
ps[p].__int_pos.Y +=l;
ps[p].__int_opos.X = ps[p].__int_pos.X;
ps[p].__int_opos.Y = ps[p].__int_pos.Y;
ps[p].__int_opos.X = ps[p].player_int_pos().X;
ps[p].__int_opos.Y = ps[p].player_int_pos().Y;
SetActor(ps[p].GetActor(), { ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z + gs.int_playerheight });
SetActor(ps[p].GetActor(), { ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z + gs.int_playerheight });
}
sc->addfloorxpan(-x / 8.f);
@ -4330,14 +4330,14 @@ void handle_se27(DDukeActor* actor)
}
else if (ud.recstat == 2 && ps[p].newOwner == nullptr)
{
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z, ps[p].cursector))
{
if (x < sh)
{
ud.cameraactor = actor;
actor->temp_data[0] = 999;
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) >> 3;
actor->spr.yvel = 100 + ((actor->int_pos().Z - ps[p].__int_pos.Z) / 257);
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y)) >> 3;
actor->spr.yvel = 100 + ((actor->int_pos().Z - ps[p].player_int_pos().Z) / 257);
}
else if (actor->temp_data[0] == 999)
@ -4351,7 +4351,7 @@ void handle_se27(DDukeActor* actor)
}
else
{
actor->spr.ang = getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y);
actor->spr.ang = getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y);
if (actor->temp_data[0] == 999)
{
@ -4418,7 +4418,7 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
{
if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{
if (abs(ps[p].__int_pos.Z - ps[p].truefz * zworldtoint) < gs.int_playerheight + (9 << 8))
if (abs(ps[p].player_int_pos().Z - ps[p].truefz * zworldtoint) < gs.int_playerheight + (9 << 8))
{
ps[p].fric.X += x << 3;
ps[p].fric.Y += y << 3;
@ -5239,8 +5239,8 @@ void movefta(void)
{
if (badguy(act))
{
px = ps[p].__int_opos.X + 64 - (krand() & 127);
py = ps[p].__int_opos.Y + 64 - (krand() & 127);
px = ps[p].player_int_opos().X + 64 - (krand() & 127);
py = ps[p].player_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].__int_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].player_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].__int_opos.X, ps[p].__int_opos.Y, ps[p].__int_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].player_int_opos().X, ps[p].player_int_opos().Y, ps[p].player_int_opos().Z - ((r1 & 31) << 8), ps[p].cursector);
}

View file

@ -1824,17 +1824,17 @@ void movetransports_d(void)
}
else if (!(sectlotag == 1 && ps[p].on_ground == 1)) break;
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].__int_pos.Z) < 6144)
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].player_int_pos().Z) < 6144)
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) ||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{
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;
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].__int_opos.Z = ps[p].__int_pos.Z;
ps[p].__int_opos.Z = ps[p].player_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);
@ -1847,7 +1847,7 @@ void movetransports_d(void)
int k = 0;
if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].__int_pos.Z > (sectp->int_floorz() - (16 << 8)) && (PlayerInput(p, SB_CROUCH) || ps[p].vel.Z > 2048))
if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].player_int_pos().Z > (sectp->int_floorz() - (16 << 8)) && (PlayerInput(p, SB_CROUCH) || ps[p].vel.Z > 2048))
// if( onfloorz && sectlotag == 1 && ps[p].pos.z > (sectp->floorz-(6<<8)) )
{
k = 1;
@ -1865,7 +1865,7 @@ void movetransports_d(void)
}
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].player_int_pos().Z < (sectp->int_ceilingz() + (6 << 8)))
{
k = 1;
// if( act2->spr.extra <= 0) break;
@ -1885,14 +1885,14 @@ void movetransports_d(void)
if (k == 1)
{
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;
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;
ps[p].setCursector(Owner->sector());
ChangeActorSect(act2, Owner->sector());
SetActor(ps[p].GetActor(), { ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z + gs.int_playerheight });
SetActor(ps[p].GetActor(), { ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z + gs.int_playerheight });
if ((krand() & 255) < 32)
spawn(act2, WATERSPLASH2);
@ -2124,7 +2124,7 @@ static void greenslime(DDukeActor *actor)
}
else if (x < 1024 && ps[p].quick_kick == 0)
{
j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y));
j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].player_int_pos().X, actor->int_pos().Y - ps[p].player_int_pos().Y));
if (j > -128 && j < 128)
ps[p].quick_kick = 14;
}
@ -2172,7 +2172,7 @@ static void greenslime(DDukeActor *actor)
return;
}
actor->set_int_z(ps[p].__int_pos.Z + ps[p].pyoff - actor->temp_data[2] + (8 << 8) - (ps[p].horizon.horiz.asq16() >> 12));
actor->set_int_z(ps[p].player_int_pos().Z + ps[p].pyoff - actor->temp_data[2] + (8 << 8) - (ps[p].horizon.horiz.asq16() >> 12));
if (actor->temp_data[2] > 512)
actor->temp_data[2] -= 128;
@ -2186,7 +2186,7 @@ static void greenslime(DDukeActor *actor)
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);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &ps[p].cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto ac = it.Next())
@ -2221,7 +2221,7 @@ static void greenslime(DDukeActor *actor)
actor->spr.xrepeat = 20 + bsin(actor->temp_data[1], -13);
actor->spr.yrepeat = 15 + bsin(actor->temp_data[1], -13);
actor->set_int_xy(ps[p].__int_pos.X + ps[p].angle.ang.bcos(-7), ps[p].__int_pos.Y + ps[p].angle.ang.bsin(-7));
actor->set_int_xy(ps[p].player_int_pos().X + ps[p].angle.ang.bcos(-7), ps[p].player_int_pos().Y + ps[p].angle.ang.bsin(-7));
return;
}
@ -2380,7 +2380,7 @@ static void greenslime(DDukeActor *actor)
actor->spr.xvel = 64 - bcos(actor->temp_data[1], -9);
actor->spr.ang += getincangle(actor->spr.ang,
getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) >> 3;
getangle(ps[p].player_int_pos().X - actor->int_pos().X, ps[p].player_int_pos().Y - actor->int_pos().Y)) >> 3;
// TJR
}
@ -2709,7 +2709,7 @@ DETONATEB:
}
}
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0)
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), actor->sector(), ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), actor->sector(), ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z, ps[p].cursector))
if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON])
{
if (ud.coop >= 1 && Owner == actor)
@ -3255,7 +3255,7 @@ static void handle_se28(DDukeActor* actor)
}
else if (actor->temp_data[2] > (actor->temp_data[1] >> 3) && actor->temp_data[2] < (actor->temp_data[1] >> 2))
{
int j = !!cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), ps[screenpeek].__int_pos.X, ps[screenpeek].__int_pos.Y, ps[screenpeek].__int_pos.Z, ps[screenpeek].cursector);
int j = !!cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), ps[screenpeek].player_int_pos().X, ps[screenpeek].player_int_pos().Y, ps[screenpeek].player_int_pos().Z, ps[screenpeek].cursector);
if (rnd(192) && (actor->temp_data[2] & 1))
{
@ -3506,8 +3506,8 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (a & face_player)
{
if (ps[playernum].newOwner != nullptr)
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);
goalang = getangle(ps[playernum].player_int_opos().X - actor->int_pos().X, ps[playernum].player_int_opos().Y - actor->int_pos().Y);
else goalang = getangle(ps[playernum].player_int_pos().X - actor->int_pos().X, ps[playernum].player_int_pos().Y - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
@ -3519,8 +3519,8 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (a & face_player_slow)
{
if (ps[playernum].newOwner != nullptr)
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);
goalang = getangle(ps[playernum].player_int_opos().X - actor->int_pos().X, ps[playernum].player_int_opos().Y - actor->int_pos().Y);
else goalang = getangle(ps[playernum].player_int_pos().X - actor->int_pos().X, ps[playernum].player_int_pos().Y - actor->int_pos().Y);
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
@ -3541,8 +3541,8 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{
int newx, newy;
newx = ps[playernum].__int_pos.X + (ps[playernum].vel.X / 768);
newy = ps[playernum].__int_pos.Y + (ps[playernum].vel.Y / 768);
newx = ps[playernum].player_int_pos().X + (ps[playernum].vel.X / 768);
newy = ps[playernum].player_int_pos().Y + (ps[playernum].vel.Y / 768);
goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
@ -3648,7 +3648,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{
daxvel = -(1024 - xvel);
angdif = getangle(ps[playernum].__int_pos.X - actor->int_pos().X, ps[playernum].__int_pos.Y - actor->int_pos().Y);
angdif = getangle(ps[playernum].player_int_pos().X - actor->int_pos().X, ps[playernum].player_int_pos().Y - actor->int_pos().Y);
if (xvel < 512)
{

View file

@ -1471,17 +1471,17 @@ void movetransports_r(void)
}
else break;
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].__int_pos.Z) < 6144)
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].player_int_pos().Z) < 6144)
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) ||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{
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;
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].__int_opos.Z = ps[p].__int_pos.Z;
ps[p].__int_opos.Z = ps[p].player_int_pos().Z;
ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(Owner->sector());
@ -1493,14 +1493,14 @@ void movetransports_r(void)
if (isRRRA())
{
if (onfloorz && sectlotag == 160 && ps[p].__int_pos.Z > (sectp->int_floorz() - (48 << 8)))
if (onfloorz && sectlotag == 160 && ps[p].player_int_pos().Z > (sectp->int_floorz() - (48 << 8)))
{
k = 2;
ps[p].__int_opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_ceilingz() + (7 << 8);
}
if (onfloorz && sectlotag == 161 && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
if (onfloorz && sectlotag == 161 && ps[p].player_int_pos().Z < (sectp->int_ceilingz() + (6 << 8)))
{
k = 2;
if (ps[p].GetActor()->spr.extra <= 0) break;
@ -1509,7 +1509,7 @@ void movetransports_r(void)
}
}
if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].__int_pos.Z > (sectp->int_floorz() - (6 << 8))) ||
if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].player_int_pos().Z > (sectp->int_floorz() - (6 << 8))) ||
(onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].OnMotorcycle))
{
if (ps[p].OnBoat) break;
@ -1525,7 +1525,7 @@ void movetransports_r(void)
ps[p].moto_underwater = 1;
}
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].player_int_pos().Z < (sectp->int_ceilingz() + (6 << 8)))
{
k = 1;
if (ps[p].GetActor()->spr.extra <= 0) break;
@ -1542,7 +1542,7 @@ void movetransports_r(void)
if (k == 1)
{
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;
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;
@ -1556,7 +1556,7 @@ void movetransports_r(void)
else if (isRRRA() && k == 2)
{
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;
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;
@ -2494,7 +2494,7 @@ DETONATEB:
}
}
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0)
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), actor->sector(), ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (cansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), actor->sector(), ps[p].player_int_pos().X, ps[p].player_int_pos().Y, ps[p].player_int_pos().Z, ps[p].cursector))
if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON])
if (actor->spr.pal == 0)
{
@ -3488,8 +3488,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & face_player)
{
if (ps[pnum].newOwner != nullptr)
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);
goalang = getangle(ps[pnum].player_int_opos().X - actor->int_pos().X, ps[pnum].player_int_opos().Y - actor->int_pos().Y);
else goalang = getangle(ps[pnum].player_int_pos().X - actor->int_pos().X, ps[pnum].player_int_pos().Y - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
@ -3501,8 +3501,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & face_player_slow)
{
if (ps[pnum].newOwner != nullptr)
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);
goalang = getangle(ps[pnum].player_int_opos().X - actor->int_pos().X, ps[pnum].player_int_opos().Y - actor->int_pos().Y);
else goalang = getangle(ps[pnum].player_int_pos().X - actor->int_pos().X, ps[pnum].player_int_pos().Y - actor->int_pos().Y);
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
@ -3517,8 +3517,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (a & antifaceplayerslow)
{
if (ps[pnum].newOwner != nullptr)
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;
goalang = (getangle(ps[pnum].player_int_opos().X - actor->int_pos().X, ps[pnum].player_int_opos().Y - actor->int_pos().Y) + 1024) & 2047;
else goalang = (getangle(ps[pnum].player_int_pos().X - actor->int_pos().X, ps[pnum].player_int_pos().Y - actor->int_pos().Y) + 1024) & 2047;
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
@ -3584,8 +3584,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{
int newx, newy;
newx = ps[pnum].__int_pos.X + (ps[pnum].vel.X / 768);
newy = ps[pnum].__int_pos.Y + (ps[pnum].vel.Y / 768);
newx = ps[pnum].player_int_pos().X + (ps[pnum].vel.X / 768);
newy = ps[pnum].player_int_pos().Y + (ps[pnum].vel.Y / 768);
goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
@ -3685,7 +3685,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{
daxvel = -(1024 - xvel);
angdif = getangle(ps[pnum].__int_pos.X - actor->int_pos().X, ps[pnum].__int_pos.Y - actor->int_pos().Y);
angdif = getangle(ps[pnum].player_int_pos().X - actor->int_pos().X, ps[pnum].player_int_pos().Y - actor->int_pos().Y);
if (xvel < 512)
{

View file

@ -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].__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_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].player_int_pos().X - ps[h->spr.yvel].player_int_opos().X, 16));
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].player_int_pos().Y - ps[h->spr.yvel].player_int_opos().Y, 16));
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].player_int_opos().Z, ps[h->spr.yvel].player_int_pos().Z, smoothratio));
t->pos.Z += gs.playerheight;
}
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
@ -205,8 +205,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
{
int sqa =
getangle(
OwnerAc->int_pos().X - ps[screenpeek].__int_pos.X,
OwnerAc->int_pos().Y - ps[screenpeek].__int_pos.Y);
OwnerAc->int_pos().X - ps[screenpeek].player_int_pos().X,
OwnerAc->int_pos().Y - ps[screenpeek].player_int_pos().Y);
int sqb =
getangle(
OwnerAc->int_pos().X - t->int_pos().X,
@ -355,7 +355,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
if (h->GetOwner())
newtspr->set_int_z(ps[p].__int_pos.Z - (12 << 8));
newtspr->set_int_z(ps[p].player_int_pos().Z - (12 << 8));
else newtspr->set_int_z(h->int_pos().Z - (51 << 8));
if (ps[p].curr_weapon == HANDBOMB_WEAPON)
{
@ -576,7 +576,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
daz = h->actor_int_floorz();
if ((h->int_pos().Z - daz) < (8 << 8) && ps[screenpeek].__int_pos.Z < daz)
if ((h->int_pos().Z - daz) < (8 << 8) && ps[screenpeek].player_int_pos().Z < daz)
{
auto shadowspr = tsprites.newTSprite();
*shadowspr = *t;
@ -602,7 +602,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
// Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].__int_pos.X, shadowspr->int_pos().Y - ps[screenpeek].__int_pos.Y);
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].player_int_pos().X, shadowspr->int_pos().Y - ps[screenpeek].player_int_pos().Y);
shadowspr->add_int_x(bcos(look, -9));
shadowspr->add_int_y(bsin(look, -9));
}

View file

@ -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].__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_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].player_int_pos().X - ps[h->spr.yvel].player_int_opos().X, 16));
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].player_int_pos().Y - ps[h->spr.yvel].player_int_opos().Y, 16));
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].player_int_opos().Z, ps[h->spr.yvel].player_int_pos().Z, smoothratio));
t->pos.Z += gs.playerheight;
h->spr.xrepeat = 24;
h->spr.yrepeat = 17;
@ -200,8 +200,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
{
int sqa =
getangle(
OwnerAc->int_pos().X - ps[screenpeek].__int_pos.X,
OwnerAc->int_pos().Y - ps[screenpeek].__int_pos.Y);
OwnerAc->int_pos().X - ps[screenpeek].player_int_pos().X,
OwnerAc->int_pos().Y - ps[screenpeek].player_int_pos().Y);
int sqb =
getangle(
OwnerAc->int_pos().X - t->int_pos().X,
@ -397,7 +397,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
if (h->GetOwner())
newtspr->set_int_z(ps[p].__int_pos.Z - (12 << 8));
newtspr->set_int_z(ps[p].player_int_pos().Z - (12 << 8));
else newtspr->set_int_z(h->int_pos().Z - (51 << 8));
if (ps[p].curr_weapon == HANDBOMB_WEAPON)
{
@ -734,7 +734,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
daz = h->actor_int_floorz();
if ((h->int_pos().Z - daz) < (8 << 8))
if (ps[screenpeek].__int_pos.Z < daz)
if (ps[screenpeek].player_int_pos().Z < daz)
{
auto shadowspr = tsprites.newTSprite();
*shadowspr = *t;
@ -760,7 +760,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
// Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].__int_pos.X, shadowspr->int_pos().Y - ps[screenpeek].__int_pos.Y);
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].player_int_pos().X, shadowspr->int_pos().Y - ps[screenpeek].player_int_pos().Y);
shadowspr->add_int_x(bcos(look, -9));
shadowspr->add_int_y(bsin(look, -9));
}

View file

@ -61,7 +61,7 @@ FString GameInterface::GetCoordString()
FString out;
out.Format("pos= %d, %d, %d - angle = %2.3f - sector = %d, lotag = %d, hitag = %d",
ps[snum].__int_pos.X, ps[snum].__int_pos.Y, ps[snum].__int_pos.Z, ps[snum].angle.ang.asdeg(), sectnum(ps[snum].cursector),
ps[snum].player_int_pos().X, ps[snum].player_int_pos().Y, ps[snum].player_int_pos().Z, ps[snum].angle.ang.asdeg(), sectnum(ps[snum].cursector),
ps[snum].cursector->lotag, ps[snum].cursector->hitag);
return out;
@ -279,15 +279,15 @@ void drawoverlays(double smoothratio)
}
else
{
cposx = interpolatedvalue(pp->__int_opos.X, pp->__int_pos.X, smoothratio);
cposy = interpolatedvalue(pp->__int_opos.Y, pp->__int_pos.Y, smoothratio);
cposx = interpolatedvalue(pp->player_int_opos().X, pp->player_int_pos().X, smoothratio);
cposy = interpolatedvalue(pp->player_int_opos().Y, pp->player_int_pos().Y, smoothratio);
cang = (!SyncInput() ? pp->angle.ang : interpolatedangle(pp->angle.oang, pp->angle.ang, smoothratio)).asbuild();
}
}
else
{
cposx = pp->__int_opos.X;
cposy = pp->__int_opos.Y;
cposx = pp->player_int_opos().X;
cposy = pp->player_int_opos().Y;
cang = pp->angle.oang.asbuild();
}
DrawOverheadMap(cposx, cposy, cang, smoothratio);
@ -577,7 +577,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
else
i = TILE_APLAYERTOP;
j = abs(int(pp.truefz * zworldtoint) - pp.__int_pos.Z) >> 8;
j = abs(int(pp.truefz * zworldtoint) - pp.player_int_pos().Z) >> 8;
j = czoom * (act->spr.yrepeat + j);
if (j < 22000) j = 22000;

View file

@ -326,15 +326,15 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_POSX: // oh, my... :( Writing to these has been disabled until I know how to do it without the engine shitting all over itself.
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.X, sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].player_int_pos().X, sActor, sPlayer);
break;
case PLAYER_POSY:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.Y, sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].player_int_pos().Y, sActor, sPlayer);
break;
case PLAYER_POSZ:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.Z, sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].player_int_pos().Z, sActor, sPlayer);
break;
case PLAYER_HORIZ:
@ -379,17 +379,17 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
case PLAYER_OPOSX:
if (bSet) ps[iPlayer].__int_opos.X = lValue;
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.X, sActor, sPlayer);
else SetGameVarID(lVar2, ps[iPlayer].player_int_opos().X, sActor, sPlayer);
break;
case PLAYER_OPOSY:
if (bSet) ps[iPlayer].__int_opos.Y = lValue;
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.Y, sActor, sPlayer);
else SetGameVarID(lVar2, ps[iPlayer].player_int_opos().Y, sActor, sPlayer);
break;
case PLAYER_OPOSZ:
if (bSet) ps[iPlayer].__int_opos.Z = lValue;
else SetGameVarID(lVar2, ps[iPlayer].__int_opos.Z, sActor, sPlayer);
else SetGameVarID(lVar2, ps[iPlayer].player_int_opos().Z, sActor, sPlayer);
break;
case PLAYER_PYOFF:
@ -1522,12 +1522,12 @@ int ParseState::parse(void)
parseifelse(ifcanshoottarget(g_ac, g_p, g_x));
break;
case concmd_ifcanseetarget:
j = cansee(g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z - ((krand() & 41) << 8), g_ac->sector(), ps[g_p].__int_pos.X, ps[g_p].__int_pos.Y, ps[g_p].__int_pos.Z/*-((krand()&41)<<8)*/, ps[g_p].GetActor()->sector());
j = cansee(g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z - ((krand() & 41) << 8), g_ac->sector(), ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, ps[g_p].__int_pos.Z/*-((krand()&41)<<8)*/, ps[g_p].GetActor()->sector());
parseifelse(j);
if (j) g_ac->timetosleep = SLEEPTIME;
break;
case concmd_ifnocover:
j = cansee(g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z, g_ac->sector(), ps[g_p].__int_pos.X, ps[g_p].__int_pos.Y, ps[g_p].__int_pos.Z, ps[g_p].GetActor()->sector());
j = cansee(g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z, g_ac->sector(), ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, ps[g_p].player_int_pos().Z, ps[g_p].GetActor()->sector());
parseifelse(j);
if (j) g_ac->timetosleep = SLEEPTIME;
break;
@ -1982,7 +1982,7 @@ int ParseState::parse(void)
case concmd_larrybird:
insptr++;
ps[g_p].__int_pos.Z = ps[g_p].GetActor()->sector()->int_ceilingz();
ps[g_p].GetActor()->set_int_z(ps[g_p].__int_pos.Z);
ps[g_p].GetActor()->set_int_z(ps[g_p].player_int_pos().Z);
break;
case concmd_destroyit:
insptr++;
@ -2047,11 +2047,11 @@ 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].__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].__int_pos.X = ps[g_p].player_int_opos().X;
ps[g_p].__int_pos.Y = ps[g_p].player_int_opos().Y;
ps[g_p].__int_pos.Z = ps[g_p].player_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);
updatesector(ps[g_p].player_int_pos().X,ps[g_p].player_int_pos().Y,&ps[g_p].cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto actj = it.Next())
@ -2226,10 +2226,10 @@ 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].__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->set_int_pos({ ps[g_p].bobpos.X = ps[g_p].__int_opos.X = ps[g_p].player_int_pos().X, ps[g_p].bobpos.Y = ps[g_p].__int_opos.Y = ps[g_p].player_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.int_playerheight });
updatesector(ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, &ps[g_p].cursector);
SetActor(ps[g_p].GetActor(), { ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, ps[g_p].player_int_pos().Z + gs.int_playerheight });
g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
g_ac->spr.shade = -12;
@ -2403,7 +2403,7 @@ int ParseState::parse(void)
j = 1;
else if( (l& prunning) && s >= 8 && PlayerInput(g_p, SB_RUN) )
j = 1;
else if( (l& phigher) && ps[g_p].__int_pos.Z < (g_ac->int_pos().Z-(48<<8)) )
else if( (l& phigher) && ps[g_p].player_int_pos().Z < (g_ac->int_pos().Z-(48<<8)) )
j = 1;
else if( (l& pwalkingback) && s <= -8 && !(PlayerInput(g_p, SB_RUN)) )
j = 1;
@ -2426,9 +2426,9 @@ int ParseState::parse(void)
else if( (l& pfacing) )
{
if (g_ac->isPlayer() && ud.multimode > 1)
j = getincangle(ps[otherp].angle.ang.asbuild(), getangle(ps[g_p].__int_pos.X - ps[otherp].__int_pos.X, ps[g_p].__int_pos.Y - ps[otherp].__int_pos.Y));
j = getincangle(ps[otherp].angle.ang.asbuild(), getangle(ps[g_p].player_int_pos().X - ps[otherp].player_int_pos().X, ps[g_p].player_int_pos().Y - ps[otherp].player_int_pos().Y));
else
j = getincangle(ps[g_p].angle.ang.asbuild(), getangle(g_ac->int_pos().X - ps[g_p].__int_pos.X, g_ac->int_pos().Y - ps[g_p].__int_pos.Y));
j = getincangle(ps[g_p].angle.ang.asbuild(), getangle(g_ac->int_pos().X - ps[g_p].player_int_pos().X, g_ac->int_pos().Y - ps[g_p].player_int_pos().Y));
if( j > -128 && j < 128 )
j = 1;
@ -2792,7 +2792,7 @@ int ParseState::parse(void)
case concmd_pstomp:
insptr++;
if( ps[g_p].knee_incs == 0 && ps[g_p].GetActor()->spr.xrepeat >= (isRR()? 9: 40) )
if( cansee(g_ac->int_pos().X,g_ac->int_pos().Y,g_ac->int_pos().Z-(4<<8),g_ac->sector(),ps[g_p].__int_pos.X,ps[g_p].__int_pos.Y,ps[g_p].__int_pos.Z+(16<<8),ps[g_p].GetActor()->sector()) )
if( cansee(g_ac->int_pos().X,g_ac->int_pos().Y,g_ac->int_pos().Z-(4<<8),g_ac->sector(),ps[g_p].player_int_pos().X,ps[g_p].player_int_pos().Y,ps[g_p].__int_pos.Z+(16<<8),ps[g_p].GetActor()->sector()) )
{
ps[g_p].knee_incs = 1;
if(ps[g_p].weapon_pos == 0)

View file

@ -285,9 +285,9 @@ void hud_input(int plnum)
auto pactor =
EGS(p->cursector,
p->__int_pos.X,
p->__int_pos.Y,
p->__int_pos.Z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.asbuild(), 0, 0, nullptr, 10);
p->player_int_pos().X,
p->player_int_pos().Y,
p->player_int_pos().Z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.asbuild(), 0, 0, nullptr, 10);
pactor->temp_data[3] = pactor->temp_data[4] = 0;
p->holoduke_on = pactor;
pactor->spr.yvel = plnum;

View file

@ -35,8 +35,8 @@ int madenoise(int snum)
player_struct *p;
p = &ps[snum];
p->donoise = 1;
p->noise.X = p->__int_pos.X;
p->noise.Y = p->__int_pos.Y;
p->noise.X = p->player_int_pos().X;
p->noise.Y = p->player_int_pos().Y;
return 1;
}

View file

@ -511,8 +511,8 @@ void footprints(int snum)
while (auto act = it.Next())
{
if (act->spr.picnum == TILE_FOOTPRINTS || act->spr.picnum == TILE_FOOTPRINTS2 || act->spr.picnum == TILE_FOOTPRINTS3 || act->spr.picnum == TILE_FOOTPRINTS4)
if (abs(act->int_pos().X - p->__int_pos.X) < 384)
if (abs(act->int_pos().Y - p->__int_pos.Y) < 384)
if (abs(act->int_pos().X - p->player_int_pos().X) < 384)
if (abs(act->int_pos().Y - p->player_int_pos().Y) < 384)
{
j = 1;
break;
@ -612,7 +612,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
{
if (p->on_warping_sector == 0)
{
if (abs(p->__int_pos.Z - fz) > (gs.int_playerheight >> 1))
if (abs(p->player_int_pos().Z - fz) > (gs.int_playerheight >> 1))
p->__int_pos.Z += 348;
}
else
@ -629,12 +629,12 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
p->horizon.horizoff = p->horizon.horiz = q16horiz(0);
updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector);
pushmove(&p->__int_pos, &p->cursector, 128L, (4 << 8), (20 << 8), CLIPMASK0);
if (fz > cz + (16 << 8) && actor->spr.pal != 1)
p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->__int_pos.Z) >> 7));
p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->player_int_pos().Z) >> 7));
p->on_warping_sector = 0;
@ -769,18 +769,18 @@ void player_struct::backuppos(bool noclipping)
{
if (!noclipping)
{
__int_opos.X = __int_pos.X;
__int_opos.Y = __int_pos.Y;
__int_opos.X = player_int_pos().X;
__int_opos.Y = player_int_pos().Y;
}
else
{
__int_pos.X = __int_opos.X;
__int_pos.Y = __int_opos.Y;
__int_pos.X = player_int_opos().X;
__int_pos.Y = player_int_opos().Y;
}
__int_opos.Z = __int_pos.Z;
bobpos.X = __int_pos.X;
bobpos.Y = __int_pos.Y;
__int_opos.Z = player_int_pos().Z;
bobpos.X = player_int_pos().X;
bobpos.Y = player_int_pos().Y;
opyoff = pyoff;
}

View file

@ -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].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
zvel = (((ps[j].player_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].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
sa = getangle(ps[j].player_int_opos().X - sx, ps[j].player_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].__int_opos.Z - sz) * vel) / l;
zvel = ((ps[j].player_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].__int_opos.X, sy - ps[p].__int_opos.Y) - sa) - 1024)))
- abs(abs(getangle(sx - ps[p].player_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);
@ -382,7 +382,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
int x;
int j = findplayer(actor, &x);
sz -= (4 << 8);
zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
zvel = ((ps[j].player_int_pos().Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
if (actor->spr.picnum != BOSS1)
{
zvel += 128 - (krand() & 255);
@ -391,7 +391,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
else
{
zvel += 128 - (krand() & 255);
sa = getangle(ps[j].__int_pos.X - sx, ps[j].__int_pos.Y - sy) + 64 - (krand() & 127);
sa = getangle(ps[j].player_int_pos().X - sx, ps[j].player_int_pos().Y - sy) + 64 - (krand() & 127);
}
}
@ -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].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
zvel = (((ps[j].player_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].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
sa = getangle(ps[j].player_int_opos().X - sx, ps[j].player_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].__int_opos.Z - sz) * vel) / l;
zvel = ((ps[j].player_int_opos().Z - sz) * vel) / l;
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
sa = actor->spr.ang + (krand() & 31) - 16;
@ -947,7 +947,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
int x;
int j = findplayer(actor, &x);
sz -= (4 << 8);
zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
zvel = ((ps[j].player_int_pos().Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
zvel += 128 - (krand() & 255);
sa += 32 - (krand() & 63);
}
@ -1016,9 +1016,9 @@ void shoot_d(DDukeActor* actor, int atwith)
if (actor->isPlayer())
{
sx = ps[p].__int_pos.X;
sy = ps[p].__int_pos.Y;
sz = ps[p].__int_pos.Z + ps[p].pyoff + (4 << 8);
sx = ps[p].player_int_pos().X;
sy = ps[p].player_int_pos().Y;
sz = ps[p].player_int_pos().Z + ps[p].pyoff + (4 << 8);
sa = ps[p].angle.ang.asbuild();
ps[p].crack_time = CRACK_TIME;
@ -1148,7 +1148,7 @@ void shoot_d(DDukeActor* actor, int atwith)
{
j = findplayer(actor, &x);
l = ldist(ps[j].GetActor(), actor);
zvel = ((ps[j].__int_opos.Z - sz) * 512) / l;
zvel = ((ps[j].player_int_opos().Z - sz) * 512) / l;
}
else zvel = 0;
@ -1726,9 +1726,9 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
if (psectlotag != 2 && p->scuba_on == 1)
p->scuba_on = 0;
if (p->__int_pos.Z > (fz - (k << 8)))
p->__int_pos.Z += ((fz - (k << 8)) - p->__int_pos.Z) >> 1;
if (p->__int_pos.Z < (pact->actor_int_ceilingz() + (18 << 8)))
if (p->player_int_pos().Z > (fz - (k << 8)))
p->__int_pos.Z += ((fz - (k << 8)) - p->player_int_pos().Z) >> 1;
if (p->player_int_pos().Z < (pact->actor_int_ceilingz() + (18 << 8)))
p->__int_pos.Z = pact->actor_int_ceilingz() + (18 << 8);
}
@ -1783,11 +1783,11 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
footprints(snum);
}
if (p->__int_pos.Z < (fz - (i << 8))) //falling
if (p->player_int_pos().Z < (fz - (i << 8))) //falling
{
// not jumping or crouching
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->__int_pos.Z >= (fz - (i << 8) - (16 << 8)))
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->player_int_pos().Z >= (fz - (i << 8) - (16 << 8)))
p->__int_pos.Z = fz - (i << 8);
else
{
@ -1801,7 +1801,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
S_PlayActorSound(DUKE_SCREAM, pact);
}
if ((p->__int_pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
if ((p->player_int_pos().Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
{
S_StopSound(DUKE_SCREAM, pact);
if (!p->insector() || p->cursector->lotag != 1)
@ -1845,7 +1845,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
{
//Smooth on the ground
int k = ((fz - (i << 8)) - p->__int_pos.Z) >> 1;
int k = ((fz - (i << 8)) - p->player_int_pos().Z) >> 1;
if (abs(k) < 256) k = 0;
p->__int_pos.Z += k;
p->vel.Z -= 768;
@ -1853,8 +1853,8 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
}
else if (p->jumping_counter == 0)
{
p->__int_pos.Z += ((fz - (i << 7)) - p->__int_pos.Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->__int_pos.Z > fz - (16 << 8))
p->__int_pos.Z += ((fz - (i << 7)) - p->player_int_pos().Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->player_int_pos().Z > fz - (16 << 8))
{
p->__int_pos.Z = fz - (16 << 8);
p->vel.Z >>= 1;
@ -1909,7 +1909,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
p->__int_pos.Z += p->vel.Z;
if (p->__int_pos.Z < (cz + (4 << 8)))
if (p->player_int_pos().Z < (cz + (4 << 8)))
{
p->jumping_counter = 0;
if (p->vel.Z < 0)
@ -1976,10 +1976,10 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
p->__int_pos.Z += p->vel.Z;
if (p->__int_pos.Z > (fz - (15 << 8)))
p->__int_pos.Z += ((fz - (15 << 8)) - p->__int_pos.Z) >> 1;
if (p->player_int_pos().Z > (fz - (15 << 8)))
p->__int_pos.Z += ((fz - (15 << 8)) - p->player_int_pos().Z) >> 1;
if (p->__int_pos.Z < (cz + (4 << 8)))
if (p->player_int_pos().Z < (cz + (4 << 8)))
{
p->__int_pos.Z = cz + (4 << 8);
p->vel.Z = 0;
@ -1993,7 +1993,7 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
j->add_int_pos({ bcos(p->angle.ang.asbuild() + 64 - (global_random & 128), -6), bsin(p->angle.ang.asbuild() + 64 - (global_random & 128), -6), 0 });
j->spr.xrepeat = 3;
j->spr.yrepeat = 2;
j->set_int_z(p->__int_pos.Z + (8 << 8));
j->set_int_z(p->player_int_pos().Z + (8 << 8));
}
}
}
@ -2032,9 +2032,9 @@ int operateTripbomb(int snum)
if (act == nullptr && hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0)
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))
if (((hit.hitpos.X - p->player_int_pos().X) * (hit.hitpos.X - p->player_int_pos().X) + (hit.hitpos.Y - p->player_int_pos().Y) * (hit.hitpos.Y - p->player_int_pos().Y)) < (290 * 290))
{
p->__int_pos.Z = p->__int_opos.Z;
p->__int_pos.Z = p->player_int_opos().Z;
p->vel.Z = 0;
return 1;
}
@ -2199,9 +2199,9 @@ static void operateweapon(int snum, ESyncBits actions)
}
auto spawned = EGS(p->cursector,
p->__int_pos.X + p->angle.ang.bcos(-6),
p->__int_pos.Y + p->angle.ang.bsin(-6),
p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->player_int_pos().X + p->angle.ang.bcos(-6),
p->player_int_pos().Y + p->angle.ang.bsin(-6),
p->player_int_pos().Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, pact, 1);
if (isNam())
@ -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->__int_opos.Z;
p->__int_pos.Z = p->player_int_opos().Z;
p->vel.Z = 0;
if (p->kickback_pic == 3)
fi.shoot(pact, HANDHOLDINGLASER);
@ -2738,12 +2738,12 @@ void processinput_d(int snum)
shrunk = (pact->spr.yrepeat < 32);
getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 163, CLIPMASK0);
j = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
j = getflorzofslopeptr(psectp, p->player_int_pos().X, p->player_int_pos().Y);
p->truefz = j * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y) * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->player_int_pos().X, p->player_int_pos().Y) * zinttoworld;
truefdist = abs(p->__int_pos.Z - j);
truefdist = abs(p->player_int_pos().Z - j);
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.int_playerheight + (16 << 8))
psectlotag = 0;
@ -2775,7 +2775,7 @@ void processinput_d(int snum)
}
else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(pact->int_pos().Z - clz.actor()->int_pos().Z) < (84 << 8))
{
j = getangle(clz.actor()->int_pos().X - p->__int_pos.X, clz.actor()->int_pos().Y - p->__int_pos.Y);
j = getangle(clz.actor()->int_pos().X - p->player_int_pos().X, clz.actor()->int_pos().Y - p->player_int_pos().Y);
p->vel.X -= bcos(j, 4);
p->vel.Y -= bsin(j, 4);
}
@ -2855,7 +2855,7 @@ void processinput_d(int snum)
p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->__int_pos.X - p->bobpos.X) * (p->__int_pos.X - p->bobpos.X) + (p->__int_pos.Y - p->bobpos.Y) * (p->__int_pos.Y - p->bobpos.Y)), 0, 512);
pact->spr.xvel = clamp(ksqrt((p->player_int_pos().X - p->bobpos.X) * (p->player_int_pos().X - p->bobpos.X) + (p->player_int_pos().Y - p->bobpos.Y) * (p->player_int_pos().Y - p->bobpos.Y)), 0, 512);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector()));
@ -3027,8 +3027,8 @@ HORIZONLY:
if (ud.clipping)
{
p->__int_pos.X += p->vel.X >> 14;
p->__int_pos.Y += p->vel.Y >> 14;
updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
p->__int_pos.Y +=p->vel.Y >> 14;
updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector);
ChangeActorSect(pact, p->cursector);
}
else
@ -3056,7 +3056,7 @@ HORIZONLY:
}
// RBG***
SetActor(pact, { p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + gs.int_playerheight });
SetActor(pact, { p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + gs.int_playerheight });
if (psectlotag < 3)
{

View file

@ -244,7 +244,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
int x;
int j = findplayer(actor, &x);
sz -= (4 << 8);
zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
zvel = ((ps[j].player_int_pos().Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
if (actor->spr.picnum != BOSS1)
{
zvel += 128 - (krand() & 255);
@ -253,7 +253,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
else
{
zvel += 128 - (krand() & 255);
sa = getangle(ps[j].__int_pos.X - sx, ps[j].__int_pos.Y - sy) + 64 - (krand() & 127);
sa = getangle(ps[j].player_int_pos().X - sx, ps[j].player_int_pos().Y - sy) + 64 - (krand() & 127);
}
}
@ -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].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
zvel = (((ps[j].player_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].__int_opos.X - sx, ps[j].__int_opos.Y - sy);
sa = getangle(ps[j].player_int_opos().X - sx, ps[j].player_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].__int_opos.Z - sz) * vel) / l;
zvel = ((ps[j].player_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].__int_opos.Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
zvel = (((ps[j].player_int_opos().Z - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor);
}
int oldzvel = zvel;
@ -835,9 +835,9 @@ void shoot_r(DDukeActor* actor, int atwith)
{
p = actor->spr.yvel;
sx = ps[p].__int_pos.X;
sy = ps[p].__int_pos.Y;
sz = ps[p].__int_pos.Z + ps[p].pyoff + (4 << 8);
sx = ps[p].player_int_pos().X;
sy = ps[p].player_int_pos().Y;
sz = ps[p].player_int_pos().Z + ps[p].pyoff + (4 << 8);
sa = ps[p].angle.ang.asbuild();
if (isRRRA()) ps[p].crack_time = CRACK_TIME;
@ -2115,15 +2115,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
footprints(snum);
}
if (p->__int_pos.Z < (fz - (i << 8))) //falling
if (p->player_int_pos().Z < (fz - (i << 8))) //falling
{
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->__int_pos.Z >= (fz - (i << 8) - (16 << 8)))
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->player_int_pos().Z >= (fz - (i << 8) - (16 << 8)))
p->__int_pos.Z = fz - (i << 8);
else
{
p->on_ground = 0;
if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->__int_pos.Z)
if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->player_int_pos().Z)
{
if (p->MotoOnGround)
{
@ -2153,7 +2153,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
S_PlayActorSound(DUKE_SCREAM, pact);
}
if ((p->__int_pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
if ((p->player_int_pos().Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
{
S_StopSound(DUKE_SCREAM, pact);
if (!p->insector() || p->cursector->lotag != 1)
@ -2213,7 +2213,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
{
//Smooth on the ground
int k = ((fz - (i << 8)) - p->__int_pos.Z) >> 1;
int k = ((fz - (i << 8)) - p->player_int_pos().Z) >> 1;
if (abs(k) < 256) k = 0;
p->__int_pos.Z += k;
p->vel.Z -= 768;
@ -2221,8 +2221,8 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
}
else if (p->jumping_counter == 0)
{
p->__int_pos.Z += ((fz - (i << 7)) - p->__int_pos.Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->__int_pos.Z > fz - (16 << 8))
p->__int_pos.Z += ((fz - (i << 7)) - p->player_int_pos().Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->player_int_pos().Z > fz - (16 << 8))
{
p->__int_pos.Z = fz - (16 << 8);
p->vel.Z >>= 1;
@ -2273,7 +2273,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
p->__int_pos.Z += p->vel.Z;
if (p->__int_pos.Z < (cz + (4 << 8)))
if (p->player_int_pos().Z < (cz + (4 << 8)))
{
p->jumping_counter = 0;
if (p->vel.Z < 0)
@ -2336,10 +2336,10 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
p->__int_pos.Z += p->vel.Z;
if (p->__int_pos.Z > (fz - (15 << 8)))
p->__int_pos.Z += ((fz - (15 << 8)) - p->__int_pos.Z) >> 1;
if (p->player_int_pos().Z > (fz - (15 << 8)))
p->__int_pos.Z += ((fz - (15 << 8)) - p->player_int_pos().Z) >> 1;
if (p->__int_pos.Z < (cz + (4 << 8)))
if (p->player_int_pos().Z < (cz + (4 << 8)))
{
p->__int_pos.Z = cz + (4 << 8);
p->vel.Z = 0;
@ -2353,7 +2353,7 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
j->add_int_pos({ bcos(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6), bsin(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6), 0 });
j->spr.xrepeat = 3;
j->spr.yrepeat = 2;
j->set_int_z(p->__int_pos.Z + (8 << 8));
j->set_int_z(p->player_int_pos().Z + (8 << 8));
j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
}
}
@ -2745,9 +2745,9 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
}
auto spawned = EGS(p->cursector,
p->__int_pos.X + p->angle.ang.bcos(-6),
p->__int_pos.Y + p->angle.ang.bsin(-6),
p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->player_int_pos().X + p->angle.ang.bcos(-6),
p->player_int_pos().Y + p->angle.ang.bsin(-6),
p->player_int_pos().Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)) * 2, i, pact, 1);
if (spawned)
@ -3161,9 +3161,9 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
}
EGS(p->cursector,
p->__int_pos.X + p->angle.ang.bcos(-6),
p->__int_pos.Y + p->angle.ang.bsin(-6),
p->__int_pos.Z, POWDERKEG, -16, 9, 9,
p->player_int_pos().X + p->angle.ang.bcos(-6),
p->player_int_pos().Y + p->angle.ang.bsin(-6),
p->player_int_pos().Z, POWDERKEG, -16, 9, 9,
p->angle.ang.asbuild(), k * 2, i, pact, 1);
}
p->kickback_pic++;
@ -3380,7 +3380,7 @@ void processinput_r(int snum)
while (auto act2 = it.Next())
{
if (act2->spr.picnum == RRTILE380)
if (act2->int_pos().Z - (8 << 8) < p->__int_pos.Z)
if (act2->int_pos().Z - (8 << 8) < p->player_int_pos().Z)
psectlotag = 2;
}
}
@ -3402,18 +3402,18 @@ void processinput_r(int snum)
if (pact->spr.clipdist == 64)
{
getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 163L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
tempfz = getflorzofslopeptr(psectp, p->player_int_pos().X, p->player_int_pos().Y);
}
else
{
getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 4L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
tempfz = getflorzofslopeptr(psectp, p->player_int_pos().X, p->player_int_pos().Y);
}
p->truefz = tempfz * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y) * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->player_int_pos().X, p->player_int_pos().Y) * zinttoworld;
truefdist = abs(p->__int_pos.Z - tempfz);
truefdist = abs(p->player_int_pos().Z - tempfz);
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.int_playerheight + (16 << 8))
psectlotag = 0;
@ -3475,7 +3475,7 @@ void processinput_r(int snum)
}
else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(pact->int_pos().Z - clz.actor()->int_pos().Z) < (84 << 8))
{
int j = getangle(clz.actor()->int_pos().X - p->__int_pos.X, clz.actor()->int_pos().Y - p->__int_pos.Y);
int j = getangle(clz.actor()->int_pos().X - p->player_int_pos().X, clz.actor()->int_pos().Y - p->player_int_pos().Y);
p->vel.X -= bcos(j, 4);
p->vel.Y -= bsin(j, 4);
}
@ -3580,7 +3580,7 @@ void processinput_r(int snum)
p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->__int_pos.X - p->bobpos.X) * (p->__int_pos.X - p->bobpos.X) + (p->__int_pos.Y - p->bobpos.Y) * (p->__int_pos.Y - p->bobpos.Y)), 0, 512);
pact->spr.xvel = clamp(ksqrt((p->player_int_pos().X - p->bobpos.X) * (p->player_int_pos().X - p->bobpos.X) + (p->player_int_pos().Y - p->bobpos.Y) * (p->player_int_pos().Y - p->bobpos.Y)), 0, 512);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector()));
@ -3796,8 +3796,8 @@ HORIZONLY:
if (ud.clipping)
{
p->__int_pos.X += p->vel.X >> 14;
p->__int_pos.Y += p->vel.Y >> 14;
updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
p->__int_pos.Y +=p->vel.Y >> 14;
updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector);
ChangeActorSect(pact, p->cursector);
}
else
@ -3898,7 +3898,7 @@ HORIZONLY:
}
// RBG***
SetActor(pact, { p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + gs.int_playerheight });
SetActor(pact, { p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + gs.int_playerheight });
if (psectlotag == 800 && (!isRRRA() || !p->lotag800kill))
{

View file

@ -342,9 +342,9 @@ void operateweapon_ww(int snum, ESyncBits actions)
}
auto j = EGS(p->cursector,
p->__int_pos.X + p->angle.ang.bcos(-6),
p->__int_pos.Y + p->angle.ang.bsin(-6),
p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->player_int_pos().X + p->angle.ang.bcos(-6),
p->player_int_pos().Y + p->angle.ang.bsin(-6),
p->player_int_pos().Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, p->GetActor(), 1);
if (j)
@ -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->__int_opos.Z;
p->__int_pos.Z = p->player_int_opos().Z;
p->vel.Z = 0;
}
if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum))

View file

@ -50,9 +50,9 @@ short myangbak[MOVEFIFOSIZ];
void resetmys()
{
myx = omyx = ps[myconnectindex].__int_pos.X;
myy = omyy = ps[myconnectindex].__int_pos.Y;
myz = omyz = ps[myconnectindex].__int_pos.Z;
myx = omyx = ps[myconnectindex].player_int_pos().X;
myy = omyy = ps[myconnectindex].player_int_pos().Y;
myz = omyz = ps[myconnectindex].player_int_pos().Z;
myxvel = myyvel = myzvel = 0;
myang = ps[myconnectindex].angle.ang;
myhoriz = omyhoriz = ps[myconnectindex].horizon.horiz;

View file

@ -541,7 +541,7 @@ void resetpspritevars(int g)
int aimmode[MAXPLAYERS];
STATUSBARTYPE tsbar[MAXPLAYERS];
EGS(ps[0].cursector, ps[0].__int_pos.X, ps[0].__int_pos.Y, ps[0].__int_pos.Z,
EGS(ps[0].cursector, ps[0].player_int_pos().X, ps[0].player_int_pos().Y, ps[0].player_int_pos().Z,
TILE_APLAYER, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, nullptr, 10);
if (ud.recstat != 2) for (i = 0; i < MAXPLAYERS; i++)
@ -611,8 +611,8 @@ void resetpspritevars(int g)
if (numplayersprites == 0)
{
firstx = ps[0].__int_pos.X;
firsty = ps[0].__int_pos.Y;
firstx = ps[0].player_int_pos().X;
firsty = ps[0].player_int_pos().Y;
}
po[numplayersprites].opos.X = act->int_pos().X;

View file

@ -305,9 +305,9 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
else
#endif
{
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);;
cposx = interpolatedvalue(p->player_int_opos().X, p->player_int_pos().X, smoothratio);
cposy = interpolatedvalue(p->player_int_opos().Y, p->player_int_pos().Y, smoothratio);
cposz = interpolatedvalue(p->player_int_opos().Z, p->player_int_pos().Z, smoothratio);;
if (SyncInput())
{
// Original code for when the values are passed through the sync struct

View file

@ -277,9 +277,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
.EndObject();
w.invdisptime = 0;
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.__int_opos.X = w.player_int_pos().X;
w.__int_opos.Y = w.player_int_pos().Y;
w.__int_opos.Z = w.player_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.

View file

@ -227,7 +227,7 @@ int findplayer(const DDukeActor* actor, int* d)
if (ud.multimode < 2)
{
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);
if (d) *d = abs(ps[myconnectindex].player_int_opos().X - s.X) + abs(ps[myconnectindex].player_int_opos().Y - s.Y) + ((abs(ps[myconnectindex].player_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].__int_opos.X - s.X) + abs(ps[j].__int_opos.Y - s.Y) + ((abs(ps[j].__int_opos.Z - s.Z + (28 << 8))) >> 4);
x = abs(ps[j].player_int_opos().X - s.X) + abs(ps[j].player_int_opos().Y - s.Y) + ((abs(ps[j].player_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].__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);
x = abs(ps[j].player_int_opos().X - ps[p].player_int_pos().X) + abs(ps[j].player_int_opos().Y - ps[p].player_int_pos().Y) + (abs(ps[j].player_int_opos().Z - ps[p].player_int_pos().Z) >> 4);
if (x < closest)
{
@ -388,7 +388,7 @@ void doanimations(void)
{
for (p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].cursector == dasectp)
if ((dasectp->int_floorz() - ps[p].__int_pos.Z) < (64 << 8))
if ((dasectp->int_floorz() - ps[p].player_int_pos().Z) < (64 << 8))
if (ps[p].GetActor()->GetOwner() != nullptr)
{
ps[p].__int_pos.Z += v;

View file

@ -922,18 +922,18 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll)
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
fi.checkhitwall(p->GetActor(), wal,
p->__int_pos.X + p->angle.ang.bcos(-9),
p->__int_pos.Y + p->angle.ang.bsin(-9),
p->__int_pos.Z, -1);
p->player_int_pos().X + p->angle.ang.bcos(-9),
p->player_int_pos().Y + p->angle.ang.bsin(-9),
p->player_int_pos().Z, -1);
break;
case BIGFORCE:
p->hurt_delay = 26;
fi.checkhitwall(p->GetActor(), wal,
p->__int_pos.X + p->angle.ang.bcos(-9),
p->__int_pos.Y + p->angle.ang.bsin(-9),
p->__int_pos.Z, -1);
p->player_int_pos().X + p->angle.ang.bcos(-9),
p->player_int_pos().Y + p->angle.ang.bsin(-9),
p->player_int_pos().Z, -1);
break;
}
@ -1441,12 +1441,12 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (ps[p].newOwner != nullptr)
{
ps[p].newOwner = nullptr;
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].__int_pos.X = ps[p].player_int_opos().X;
ps[p].__int_pos.Y = ps[p].player_int_opos().Y;
ps[p].__int_pos.Z = ps[p].player_int_opos().Z;
ps[p].angle.restore();
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &ps[p].cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto itActor = it.Next())
@ -1479,12 +1479,12 @@ void clearcameras(int i, player_struct* p)
{
if (i < 0)
{
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->__int_pos.X = p->player_int_opos().X;
p->__int_pos.Y = p->player_int_opos().Y;
p->__int_pos.Z = p->player_int_opos().Z;
p->newOwner = nullptr;
updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto act = it.Next())
@ -1593,17 +1593,17 @@ void checksectors_d(int snum)
return;
}
if (p->newOwner != nullptr)
neartag({ p->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
neartag({ p->player_int_opos().X, p->player_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);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -1409,9 +1409,9 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
case BIGFORCE:
p->hurt_delay = 26;
fi.checkhitwall(p->GetActor(), wal,
p->__int_pos.X + p->angle.ang.bcos(-9),
p->__int_pos.Y + p->angle.ang.bsin(-9),
p->__int_pos.Z, -1);
p->player_int_pos().X + p->angle.ang.bcos(-9),
p->player_int_pos().Y + p->angle.ang.bsin(-9),
p->player_int_pos().Z, -1);
break;
}
@ -2373,11 +2373,11 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (ps[p].newOwner != nullptr)
{
ps[p].newOwner = nullptr;
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].__int_pos.X = ps[p].player_int_opos().X;
ps[p].__int_pos.Y = ps[p].player_int_opos().Y;
ps[p].__int_pos.Z = ps[p].player_int_opos().Z;
updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &ps[p].cursector);
DukeStatIterator it(STAT_EFFECTOR);
while (auto act = it.Next())
@ -2530,17 +2530,17 @@ void checksectors_r(int snum)
}
if (p->newOwner != nullptr)
neartag({ p->__int_opos.X, p->__int_opos.Y, p->__int_opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
neartag({ p->player_int_opos().X, p->player_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);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag({ p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -317,7 +317,7 @@ void S_GetCamera(vec3_t* c, int32_t* ca, sectortype** cs)
if (ud.cameraactor == nullptr)
{
auto p = &ps[screenpeek];
if (c) *c = p->__int_pos;
if (c) *c = p->player_int_pos();
if (cs) *cs = p->cursector;
if (ca) *ca = p->angle.ang.asbuild();
}

View file

@ -435,7 +435,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
a = ps[snum].angle.ang.asbuild() - (krand() & 63) + 8; //Fine tune
act->temp_data[0] = krand() & 1;
act->set_int_z((3 << 8) + ps[snum].pyoff + ps[snum].__int_pos.Z - (ps[snum].horizon.sum().asq16() >> 12) + (!isshell ? (3 << 8) : 0));
act->set_int_z((3 << 8) + ps[snum].pyoff + ps[snum].player_int_pos().Z - (ps[snum].horizon.sum().asq16() >> 12) + (!isshell ? (3 << 8) : 0));
act->spr.zvel = -(krand() & 255);
}
else
@ -530,7 +530,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
actor->add_int_z(-(18 << 8));
}
else actor->add_int_z(-(13 << 8));
actor->spr.ang = getangle(ps[connecthead].__int_pos.X - actor->int_pos().X, ps[connecthead].__int_pos.Y - actor->int_pos().Y);
actor->spr.ang = getangle(ps[connecthead].player_int_pos().X - actor->int_pos().X, ps[connecthead].player_int_pos().Y - actor->int_pos().Y);
actor->spr.xvel = 48 - (krand() & 31);
ssp(actor, CLIPMASK0);
}

View file

@ -247,7 +247,7 @@ struct player_struct
double truefz, truecz;
sectortype* cursector;
sectortype* one_parallax_sectnum; // wall + sector references. Make them pointers later?
sectortype* one_parallax_sectnum; // wall + sector references.
walltype* access_wall;
DDukeActor* actor;
TObjPtr<DDukeActor*> actorsqu, wackedbyactor, on_crane, holoduke_on, somethingonplayer, access_spritenum, dummyplayersprite, newOwner;
@ -357,6 +357,18 @@ struct player_struct
{
return cursector != nullptr;
}
vec3_t player_int_pos() const
{
return __int_pos;
}
vec3_t player_int_opos() const
{
return __int_opos;
}
};
struct Cycler