- renamed player_struct::pos

This commit is contained in:
Christoph Oelckers 2022-02-04 17:52:41 +01:00
parent 6bd854da88
commit 5f4c35e9aa
25 changed files with 384 additions and 388 deletions

View file

@ -202,11 +202,9 @@ void checkavailweapon(struct player_struct* player)
void clearcamera(player_struct* ps) void clearcamera(player_struct* ps)
{ {
ps->newOwner = nullptr; ps->newOwner = nullptr;
ps->pos.X = ps->opos.X; ps->__int_pos = ps->opos;
ps->pos.Y = ps->opos.Y;
ps->pos.Z = ps->opos.Z;
ps->angle.restore(); ps->angle.restore();
updatesector(ps->pos.X, ps->pos.Y, &ps->cursector); updatesector(ps->__int_pos.X, ps->__int_pos.Y, &ps->cursector);
DukeStatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
while (auto k = it.Next()) while (auto k = it.Next())
@ -374,7 +372,7 @@ void movedummyplayers(void)
} }
} }
act->add_int_pos({ (ps[p].pos.X - ps[p].opos.X), (ps[p].pos.Y - ps[p].opos.Y), 0 }); act->add_int_pos({ (ps[p].__int_pos.X - ps[p].opos.X), (ps[p].__int_pos.Y - ps[p].opos.Y), 0 });
SetActor(act, act->int_pos()); SetActor(act, act->int_pos());
} }
} }
@ -442,7 +440,7 @@ void moveplayers(void)
if (p->actorsqu != nullptr) if (p->actorsqu != nullptr)
{ {
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->actorsqu->int_pos().X - p->pos.X, p->actorsqu->int_pos().Y - p->pos.Y)) >> 2); 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);
} }
if (act->spr.extra > 0) if (act->spr.extra > 0)
@ -457,15 +455,15 @@ void moveplayers(void)
} }
else else
{ {
p->pos.X = act->int_pos().X; p->__int_pos.X = act->int_pos().X;
p->pos.Y = act->int_pos().Y; p->__int_pos.Y = act->int_pos().Y;
p->pos.Z = act->int_pos().Z - (20 << 8); p->__int_pos.Z = act->int_pos().Z - (20 << 8);
p->newOwner = nullptr; p->newOwner = nullptr;
if (p->wackedbyactor != nullptr && p->wackedbyactor->spr.statnum < MAXSTATUS) if (p->wackedbyactor != nullptr && p->wackedbyactor->spr.statnum < MAXSTATUS)
{ {
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->wackedbyactor->int_pos().X - p->pos.X, p->wackedbyactor->int_pos().Y - p->pos.Y)) >> 1); 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);
} }
} }
act->spr.ang = p->angle.ang.asbuild(); act->spr.ang = p->angle.ang.asbuild();
@ -792,11 +790,11 @@ void movecrane(DDukeActor *actor, int crane)
else if (actor->IsActiveCrane()) else if (actor->IsActiveCrane())
{ {
auto ang = ps[p].angle.ang.asbuild(); auto ang = ps[p].angle.ang.asbuild();
ps[p].opos = ps[p].pos; ps[p].opos = ps[p].__int_pos;
ps[p].pos.X = actor->int_pos().X - bcos(ang, -6); ps[p].__int_pos.X = actor->int_pos().X - bcos(ang, -6);
ps[p].pos.Y = actor->int_pos().Y - bsin(ang, -6); ps[p].__int_pos.Y = actor->int_pos().Y - bsin(ang, -6);
ps[p].pos.Z = actor->int_pos().Z + (2 << 8); ps[p].__int_pos.Z = actor->int_pos().Z + (2 << 8);
SetActor(ps[p].GetActor(), ps[p].pos); SetActor(ps[p].GetActor(), ps[p].__int_pos);
ps[p].setCursector(ps[p].GetActor()->sector()); ps[p].setCursector(ps[p].GetActor()->sector());
} }
} }
@ -1099,7 +1097,7 @@ void movetouchplate(DDukeActor* actor, int plate)
{ {
sectp->add_int_floorz(sectp->extra); sectp->add_int_floorz(sectp->extra);
p = checkcursectnums(actor->sector()); p = checkcursectnums(actor->sector());
if (p >= 0) ps[p].pos.Z += sectp->extra; if (p >= 0) ps[p].__int_pos.Z += sectp->extra;
} }
} }
else else
@ -1114,7 +1112,7 @@ void movetouchplate(DDukeActor* actor, int plate)
sectp->add_int_floorz(-sectp->extra); sectp->add_int_floorz(-sectp->extra);
p = checkcursectnums(actor->sector()); p = checkcursectnums(actor->sector());
if (p >= 0) if (p >= 0)
ps[p].pos.Z -= sectp->extra; ps[p].__int_pos.Z -= sectp->extra;
} }
} }
return; return;
@ -1502,7 +1500,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{ {
// if(actor->spr.pal == 12) // if(actor->spr.pal == 12)
{ {
int j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].pos.X, actor->int_pos().Y - ps[p].pos.Y)); 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));
if (j > -64 && j < 64 && PlayerInput(p, SB_OPEN)) if (j > -64 && j < 64 && PlayerInput(p, SB_OPEN))
if (ps[p].toggle_key_flag == 1) if (ps[p].toggle_key_flag == 1)
{ {
@ -1512,7 +1510,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{ {
if (act2->spr.picnum == queball || act2->spr.picnum == stripeball) if (act2->spr.picnum == queball || act2->spr.picnum == stripeball)
{ {
j = getincangle(ps[p].angle.ang.asbuild(), getangle(act2->int_pos().X - ps[p].pos.X, act2->int_pos().Y - ps[p].pos.Y)); 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));
if (j > -64 && j < 64) if (j > -64 && j < 64)
{ {
int l; int l;
@ -1534,7 +1532,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
} }
if (x < 512 && actor->sector() == ps[p].cursector) if (x < 512 && actor->sector() == ps[p].cursector)
{ {
actor->spr.ang = getangle(actor->int_pos().X - ps[p].pos.X, actor->int_pos().Y - ps[p].pos.Y); actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
actor->spr.xvel = 48; actor->spr.xvel = 48;
} }
} }
@ -1680,13 +1678,13 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
fi.shoot(actor, firelaser); fi.shoot(actor, firelaser);
actor->spr.ang = a; 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].pos.X, ps[p].pos.Y, ps[p].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].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
{ {
actor->temp_data[0] = 0; actor->temp_data[0] = 0;
actor->temp_data[2] = 0; actor->temp_data[2] = 0;
} }
else actor->tempang += else actor->tempang +=
getincangle(actor->tempang, getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y)) / 3; getincangle(actor->tempang, getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) / 3;
} }
else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 3) else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 3)
{ {
@ -1696,14 +1694,14 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
if (actor->temp_data[0] == 2) if (actor->temp_data[0] == 2)
{ {
int l = ps[p].pos.Z - actor->int_pos().Z; int l = ps[p].__int_pos.Z - actor->int_pos().Z;
if (abs(l) < (48 << 8)) actor->temp_data[0] = 3; if (abs(l) < (48 << 8)) actor->temp_data[0] = 3;
else actor->add_int_z(Sgn(ps[p].pos.Z - actor->int_pos().Z) << shift); // The shift here differs between Duke and RR. 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 else
{ {
actor->temp_data[2]++; 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].pos.X, ps[p].pos.Y, ps[p].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].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
{ {
actor->temp_data[0] = 1; actor->temp_data[0] = 1;
actor->temp_data[2] = 0; actor->temp_data[2] = 0;
@ -1714,7 +1712,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
fi.shoot(actor, firelaser); fi.shoot(actor, firelaser);
} }
} }
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y)) >> 2; 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;
} }
if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner) if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner)
@ -2684,15 +2682,15 @@ void handle_se00(DDukeActor* actor)
{ {
ps[p].angle.addadjustment(buildang(l * q)); ps[p].angle.addadjustment(buildang(l * q));
ps[p].pos.Z += zchange; ps[p].__int_pos.Z += zchange;
vec2_t res; vec2_t res;
rotatepoint(Owner->int_pos().vec2, ps[p].pos.vec2, (q * l), &res); rotatepoint(Owner->int_pos().vec2, ps[p].__int_pos.vec2, (q * l), &res);
ps[p].bobpos.X += res.X - ps[p].pos.X; ps[p].bobpos.X += res.X - ps[p].__int_pos.X;
ps[p].bobpos.Y += res.Y - ps[p].pos.Y; ps[p].bobpos.Y += res.Y - ps[p].__int_pos.Y;
ps[p].pos.vec2 = res; ps[p].__int_pos.vec2 = res;
auto psp = ps[p].GetActor(); auto psp = ps[p].GetActor();
if (psp->spr.extra <= 0) if (psp->spr.extra <= 0)
@ -2813,7 +2811,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (x < 20480) if (x < 20480)
{ {
j = actor->spr.ang; j = actor->spr.ang;
actor->spr.ang = getangle(actor->int_pos().X - ps[p].pos.X, actor->int_pos().Y - ps[p].pos.Y); actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
fi.shoot(actor, RPG); fi.shoot(actor, RPG);
actor->spr.ang = j; actor->spr.ang = j;
} }
@ -2832,11 +2830,11 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (psp->spr.extra > 0) if (psp->spr.extra > 0)
{ {
auto k = ps[p].cursector; auto k = ps[p].cursector;
updatesector(ps[p].pos.X, ps[p].pos.Y, &k); 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())) if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{ {
ps[p].pos.X = actor->int_pos().X; ps[p].__int_pos.X = actor->int_pos().X;
ps[p].pos.Y = actor->int_pos().Y; ps[p].__int_pos.Y = actor->int_pos().Y;
ps[p].setCursector(actor->sector()); ps[p].setCursector(actor->sector());
SetActor(ps[p].GetActor(), actor->int_pos()); SetActor(ps[p].GetActor(), actor->int_pos());
@ -2862,10 +2860,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (actor->sector() == psp->sector()) if (actor->sector() == psp->sector())
{ {
rotatepoint(actor->int_pos().vec2, ps[p].pos.vec2, q, &ps[p].pos.vec2); rotatepoint(actor->int_pos().vec2, ps[p].__int_pos.vec2, q, &ps[p].__int_pos.vec2);
ps[p].pos.X += m; ps[p].__int_pos.X += m;
ps[p].pos.Y += x; ps[p].__int_pos.Y += x;
ps[p].bobpos.X += m; ps[p].bobpos.X += m;
ps[p].bobpos.Y += x; ps[p].bobpos.Y += x;
@ -2874,12 +2872,12 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (numplayers > 1) if (numplayers > 1)
{ {
ps[p].opos.X = ps[p].pos.X; ps[p].opos.X = ps[p].__int_pos.X;
ps[p].opos.Y = ps[p].pos.Y; ps[p].opos.Y = ps[p].__int_pos.Y;
} }
if (psp->spr.extra <= 0) if (psp->spr.extra <= 0)
{ {
psp->set_int_xy(ps[p].pos.X, ps[p].pos.Y); psp->set_int_xy(ps[p].__int_pos.X, ps[p].__int_pos.Y);
} }
} }
} }
@ -2919,11 +2917,11 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (ps[p].GetActor()->spr.extra > 0) if (ps[p].GetActor()->spr.extra > 0)
{ {
auto k = ps[p].cursector; auto k = ps[p].cursector;
updatesector(ps[p].pos.X, ps[p].pos.Y, &k); 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())) if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{ {
ps[p].opos.X = ps[p].pos.X = actor->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X = actor->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y = actor->int_pos().Y; ps[p].opos.Y = ps[p].__int_pos.Y = actor->int_pos().Y;
ps[p].setCursector(actor->sector()); ps[p].setCursector(actor->sector());
SetActor(ps[p].GetActor(), actor->int_pos()); SetActor(ps[p].GetActor(), actor->int_pos());
@ -3020,11 +3018,11 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (psp->spr.extra > 0) if (psp->spr.extra > 0)
{ {
auto k = ps[p].cursector; auto k = ps[p].cursector;
updatesector(ps[p].pos.X, ps[p].pos.Y, &k); 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())) if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{ {
ps[p].pos.X = actor->int_pos().X; ps[p].__int_pos.X = actor->int_pos().X;
ps[p].pos.Y = actor->int_pos().Y; ps[p].__int_pos.Y = actor->int_pos().Y;
ps[p].setCursector(actor->sector()); ps[p].setCursector(actor->sector());
SetActor(ps[p].GetActor(), actor->int_pos()); SetActor(ps[p].GetActor(), actor->int_pos());
@ -3037,13 +3035,13 @@ void handle_se30(DDukeActor *actor, int JIBS6)
auto psp = ps[p].GetActor(); auto psp = ps[p].GetActor();
if (psp->sector() == actor->sector()) if (psp->sector() == actor->sector())
{ {
ps[p].pos.X += l; ps[p].__int_pos.X += l;
ps[p].pos.Y += x; ps[p].__int_pos.Y += x;
if (numplayers > 1) if (numplayers > 1)
{ {
ps[p].opos.X = ps[p].pos.X; ps[p].opos.X = ps[p].__int_pos.X;
ps[p].opos.Y = ps[p].pos.Y; ps[p].opos.Y = ps[p].__int_pos.Y;
} }
ps[p].bobpos.X += l; ps[p].bobpos.X += l;
@ -3081,14 +3079,14 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (ps[p].GetActor()->spr.extra > 0) if (ps[p].GetActor()->spr.extra > 0)
{ {
auto k = ps[p].cursector; auto k = ps[p].cursector;
updatesector(ps[p].pos.X, ps[p].pos.Y, &k); 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())) if ((k == nullptr && ud.clipping == 0) || (k == actor->sector() && ps[p].cursector != actor->sector()))
{ {
ps[p].pos.X = actor->int_pos().X; ps[p].__int_pos.X = actor->int_pos().X;
ps[p].pos.Y = actor->int_pos().Y; ps[p].__int_pos.Y = actor->int_pos().Y;
ps[p].opos.X = ps[p].pos.X; ps[p].opos.X = ps[p].__int_pos.X;
ps[p].opos.Y = ps[p].pos.Y; ps[p].opos.Y = ps[p].__int_pos.Y;
ps[p].setCursector(actor->sector()); ps[p].setCursector(actor->sector());
@ -3173,8 +3171,8 @@ void handle_se02(DDukeActor* actor)
for (int p = connecthead; p >= 0; p = connectpoint2[p]) for (int p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].cursector == actor->sector() && ps[p].on_ground) if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{ {
ps[p].pos.X += m; ps[p].__int_pos.X += m;
ps[p].pos.Y += x; ps[p].__int_pos.Y += x;
ps[p].bobpos.X += m; ps[p].bobpos.X += m;
ps[p].bobpos.Y += x; ps[p].bobpos.Y += x;
@ -3325,7 +3323,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
if (x < 8192) if (x < 8192)
{ {
j = actor->spr.ang; j = actor->spr.ang;
actor->spr.ang = getangle(actor->int_pos().X - ps[p].pos.X, actor->int_pos().Y - ps[p].pos.Y); actor->spr.ang = getangle(actor->int_pos().X - ps[p].__int_pos.X, actor->int_pos().Y - ps[p].__int_pos.Y);
fi.shoot(actor, FIRELASER); fi.shoot(actor, FIRELASER);
actor->spr.ang = j; actor->spr.ang = j;
} }
@ -3359,7 +3357,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
if (ldist(Owner, actor) < 1024) if (ldist(Owner, actor) < 1024)
{ {
auto ta = actor->spr.ang; auto ta = actor->spr.ang;
actor->spr.ang = getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y); 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 = ta; actor->spr.ang = ta;
actor->SetOwner(nullptr); actor->SetOwner(nullptr);
return; return;
@ -3379,7 +3377,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
else else
{ {
actor->temp_data[2] += actor->temp_data[2] +=
getincangle(actor->temp_data[2] + 512, getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y)) >> 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;
sc->ceilingshade = 0; sc->ceilingshade = 0;
} }
j = fi.ifhitbyweapon(actor); j = fi.ifhitbyweapon(actor);
@ -3837,11 +3835,11 @@ void handle_se17(DDukeActor* actor)
if (act1->spr.statnum == STAT_PLAYER && act1->GetOwner()) if (act1->spr.statnum == STAT_PLAYER && act1->GetOwner())
{ {
int p = act1->spr.yvel; int p = act1->spr.yvel;
if (numplayers < 2) ps[p].opos.Z = ps[p].pos.Z; if (numplayers < 2) ps[p].opos.Z = ps[p].__int_pos.Z;
ps[p].pos.Z += q * zworldtoint; ps[p].__int_pos.Z += q * zworldtoint;
ps[p].truefz += q; ps[p].truefz += q;
ps[p].truecz += q; ps[p].truecz += q;
if (numplayers > 1) ps[p].opos.Z = ps[p].pos.Z; if (numplayers > 1) ps[p].opos.Z = ps[p].__int_pos.Z;
} }
if (act1->spr.statnum != STAT_EFFECTOR) if (act1->spr.statnum != STAT_EFFECTOR)
{ {
@ -3889,16 +3887,16 @@ void handle_se17(DDukeActor* actor)
{ {
int p = act3->spr.yvel; int p = act3->spr.yvel;
ps[p].pos.X += act2->int_pos().X - actor->int_pos().X; ps[p].__int_pos.X += act2->int_pos().X - actor->int_pos().X;
ps[p].pos.Y += act2->int_pos().Y - actor->int_pos().Y; ps[p].__int_pos.Y += act2->int_pos().Y - actor->int_pos().Y;
ps[p].pos.Z = act2->sector()->int_floorz() - (sc->int_floorz() - ps[p].pos.Z); ps[p].__int_pos.Z = act2->sector()->int_floorz() - (sc->int_floorz() - ps[p].__int_pos.Z);
act3->floorz = act2->sector()->floorz; act3->floorz = act2->sector()->floorz;
act3->ceilingz = act2->sector()->ceilingz; act3->ceilingz = act2->sector()->ceilingz;
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X; ps[p].bobpos.X = ps[p].opos.X = ps[p].__int_pos.X;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y; ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y;
ps[p].opos.Z = ps[p].pos.Z; ps[p].opos.Z = ps[p].__int_pos.Z;
ps[p].truefz = act3->floorz; ps[p].truefz = act3->floorz;
ps[p].truecz = act3->ceilingz; ps[p].truecz = act3->ceilingz;
@ -3958,7 +3956,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
while (auto a2 = it.Next()) while (auto a2 = it.Next())
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z += sc->extra; if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].__int_pos.Z += sc->extra;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{ {
a2->add_int_z(sc->extra); a2->add_int_z(sc->extra);
@ -3995,7 +3993,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
while (auto a2 = it.Next()) while (auto a2 = it.Next())
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z -= sc->extra; if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].__int_pos.Z -= sc->extra;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{ {
a2->add_int_z(-sc->extra); a2->add_int_z(-sc->extra);
@ -4183,13 +4181,13 @@ void handle_se20(DDukeActor* actor)
for (int p = connecthead; p >= 0; p = connectpoint2[p]) for (int p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].cursector == actor->sector() && ps[p].on_ground) if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{ {
ps[p].pos.X += x; ps[p].__int_pos.X += x;
ps[p].pos.Y += l; ps[p].__int_pos.Y += l;
ps[p].opos.X = ps[p].pos.X; ps[p].opos.X = ps[p].__int_pos.X;
ps[p].opos.Y = ps[p].pos.Y; ps[p].opos.Y = ps[p].__int_pos.Y;
SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z + gs.playerheight }); SetActor(ps[p].GetActor(), { ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z + gs.playerheight });
} }
sc->addfloorxpan(-x / 8.f); sc->addfloorxpan(-x / 8.f);
@ -4300,7 +4298,7 @@ void handle_se26(DDukeActor* actor)
{ {
ps[p].fric.X += l << 5; ps[p].fric.X += l << 5;
ps[p].fric.Y += x << 5; ps[p].fric.Y += x << 5;
ps[p].pos.Z += actor->spr.zvel; ps[p].__int_pos.Z += actor->spr.zvel;
} }
ms(actor); ms(actor);
@ -4332,14 +4330,14 @@ void handle_se27(DDukeActor* actor)
} }
else if (ud.recstat == 2 && ps[p].newOwner == nullptr) 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].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) 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 (x < sh) if (x < sh)
{ {
ud.cameraactor = actor; ud.cameraactor = actor;
actor->temp_data[0] = 999; actor->temp_data[0] = 999;
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y)) >> 3; 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].pos.Z) / 257); actor->spr.yvel = 100 + ((actor->int_pos().Z - ps[p].__int_pos.Z) / 257);
} }
else if (actor->temp_data[0] == 999) else if (actor->temp_data[0] == 999)
@ -4353,7 +4351,7 @@ void handle_se27(DDukeActor* actor)
} }
else else
{ {
actor->spr.ang = getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y); actor->spr.ang = getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y);
if (actor->temp_data[0] == 999) if (actor->temp_data[0] == 999)
{ {
@ -4420,7 +4418,7 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
{ {
if (ps[p].cursector == actor->sector() && ps[p].on_ground) if (ps[p].cursector == actor->sector() && ps[p].on_ground)
{ {
if (abs(ps[p].pos.Z - ps[p].truefz * zworldtoint) < gs.playerheight + (9 << 8)) if (abs(ps[p].__int_pos.Z - ps[p].truefz * zworldtoint) < gs.playerheight + (9 << 8))
{ {
ps[p].fric.X += x << 3; ps[p].fric.X += x << 3;
ps[p].fric.Y += y << 3; ps[p].fric.Y += y << 3;
@ -4691,7 +4689,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].pos.Z += l; ps[a2->PlayerIndex()].__int_pos.Z += l;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{ {
a2->add_int_z(l); a2->add_int_z(l);
@ -4720,7 +4718,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].pos.Z += l; ps[a2->PlayerIndex()].__int_pos.Z += l;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{ {
a2->add_int_z(l); a2->add_int_z(l);
@ -4751,7 +4749,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].pos.Z += l; ps[a2->PlayerIndex()].__int_pos.Z += l;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{ {
a2->add_int_z(l); a2->add_int_z(l);
@ -4779,7 +4777,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
{ {
if (a2->isPlayer() && a2->GetOwner()) if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1) if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].pos.Z -= l; ps[a2->PlayerIndex()].__int_pos.Z -= l;
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{ {
a2->add_int_z(-l); a2->add_int_z(-l);

View file

@ -1806,9 +1806,9 @@ void movetransports_d(void)
ps[p].transporter_hold = 13; ps[p].transporter_hold = 13;
} }
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = Owner->int_pos().X; 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].pos.Y = Owner->int_pos().Y; ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
ps[p].opos.Z = ps[p].pos.Z = Owner->int_pos().Z - gs.playerheight; ps[p].opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - gs.playerheight;
ChangeActorSect(act2, Owner->sector()); ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(act2->sector()); ps[p].setCursector(act2->sector());
@ -1824,20 +1824,20 @@ void movetransports_d(void)
} }
else if (!(sectlotag == 1 && ps[p].on_ground == 1)) break; else if (!(sectlotag == 1 && ps[p].on_ground == 1)) break;
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].pos.Z) < 6144) if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].__int_pos.Z) < 6144)
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) || if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) ||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH))) (ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{ {
ps[p].opos.X = ps[p].pos.X += Owner->int_pos().X - act->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y += Owner->int_pos().Y - act->int_pos().Y; ps[p].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)) if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].pos.Z = Owner->int_pos().Z - 6144; ps[p].__int_pos.Z = Owner->int_pos().Z - 6144;
else ps[p].pos.Z = Owner->int_pos().Z + 6144; else ps[p].__int_pos.Z = Owner->int_pos().Z + 6144;
ps[p].opos.Z = ps[p].pos.Z; ps[p].opos.Z = ps[p].__int_pos.Z;
auto pa = ps[p].GetActor(); auto pa = ps[p].GetActor();
pa->opos = DVector3(ps[p].pos.X * inttoworld, ps[p].pos.Y * inttoworld, ps[p].pos.Z * zinttoworld); pa->opos = DVector3(ps[p].__int_pos.X * inttoworld, ps[p].__int_pos.Y * inttoworld, ps[p].__int_pos.Z * zinttoworld);
ChangeActorSect(act2, Owner->sector()); ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(Owner->sector()); ps[p].setCursector(Owner->sector());
@ -1847,7 +1847,7 @@ void movetransports_d(void)
int k = 0; int k = 0;
if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].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].__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)) ) // if( onfloorz && sectlotag == 1 && ps[p].pos.z > (sectp->floorz-(6<<8)) )
{ {
k = 1; k = 1;
@ -1857,7 +1857,7 @@ void movetransports_d(void)
} }
if (ps[p].GetActor()->spr.extra > 0) if (ps[p].GetActor()->spr.extra > 0)
S_PlayActorSound(DUKE_UNDERWATER, act2); S_PlayActorSound(DUKE_UNDERWATER, act2);
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_ceilingz() + (7 << 8); Owner->sector()->int_ceilingz() + (7 << 8);
ps[p].vel.X = 4096 - (krand() & 8192); ps[p].vel.X = 4096 - (krand() & 8192);
@ -1865,7 +1865,7 @@ void movetransports_d(void)
} }
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.Z < (sectp->int_ceilingz() + (6 << 8))) if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
{ {
k = 1; k = 1;
// if( act2->spr.extra <= 0) break; // if( act2->spr.extra <= 0) break;
@ -1875,7 +1875,7 @@ void movetransports_d(void)
} }
S_PlayActorSound(DUKE_GASP, act2); S_PlayActorSound(DUKE_GASP, act2);
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_floorz() - (7 << 8); Owner->sector()->int_floorz() - (7 << 8);
ps[p].jumping_toggle = 1; ps[p].jumping_toggle = 1;
@ -1884,15 +1884,15 @@ void movetransports_d(void)
if (k == 1) if (k == 1)
{ {
ps[p].opos.X = ps[p].pos.X += Owner->int_pos().X - act->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y += Owner->int_pos().Y - act->int_pos().Y; ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
if (!Owner || Owner->GetOwner() != Owner) if (!Owner || Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2; ps[p].transporter_hold = -2;
ps[p].setCursector(Owner->sector()); ps[p].setCursector(Owner->sector());
ChangeActorSect(act2, Owner->sector()); ChangeActorSect(act2, Owner->sector());
SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z + gs.playerheight }); SetActor(ps[p].GetActor(), { ps[p].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z + gs.playerheight });
if ((krand() & 255) < 32) if ((krand() & 255) < 32)
spawn(act2, WATERSPLASH2); spawn(act2, WATERSPLASH2);
@ -2124,7 +2124,7 @@ static void greenslime(DDukeActor *actor)
} }
else if (x < 1024 && ps[p].quick_kick == 0) else if (x < 1024 && ps[p].quick_kick == 0)
{ {
j = getincangle(ps[p].angle.ang.asbuild(), getangle(actor->int_pos().X - ps[p].pos.X, actor->int_pos().Y - ps[p].pos.Y)); 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));
if (j > -128 && j < 128) if (j > -128 && j < 128)
ps[p].quick_kick = 14; ps[p].quick_kick = 14;
} }
@ -2172,7 +2172,7 @@ static void greenslime(DDukeActor *actor)
return; return;
} }
actor->set_int_z(ps[p].pos.Z + ps[p].pyoff - actor->temp_data[2] + (8 << 8) - (ps[p].horizon.horiz.asq16() >> 12)); actor->set_int_z(ps[p].__int_pos.Z + ps[p].pyoff - actor->temp_data[2] + (8 << 8) - (ps[p].horizon.horiz.asq16() >> 12));
if (actor->temp_data[2] > 512) if (actor->temp_data[2] > 512)
actor->temp_data[2] -= 128; actor->temp_data[2] -= 128;
@ -2183,12 +2183,10 @@ static void greenslime(DDukeActor *actor)
if (ps[p].newOwner != nullptr) if (ps[p].newOwner != nullptr)
{ {
ps[p].newOwner = nullptr; ps[p].newOwner = nullptr;
ps[p].pos.X = ps[p].opos.X; ps[p].__int_pos = ps[p].opos;
ps[p].pos.Y = ps[p].opos.Y;
ps[p].pos.Z = ps[p].opos.Z;
ps[p].angle.restore(); ps[p].angle.restore();
updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector); updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
DukeStatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
while (auto ac = it.Next()) while (auto ac = it.Next())
@ -2223,7 +2221,7 @@ static void greenslime(DDukeActor *actor)
actor->spr.xrepeat = 20 + bsin(actor->temp_data[1], -13); actor->spr.xrepeat = 20 + bsin(actor->temp_data[1], -13);
actor->spr.yrepeat = 15 + bsin(actor->temp_data[1], -13); actor->spr.yrepeat = 15 + bsin(actor->temp_data[1], -13);
actor->set_int_xy(ps[p].pos.X + ps[p].angle.ang.bcos(-7), ps[p].pos.Y + ps[p].angle.ang.bsin(-7)); 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));
return; return;
} }
@ -2382,7 +2380,7 @@ static void greenslime(DDukeActor *actor)
actor->spr.xvel = 64 - bcos(actor->temp_data[1], -9); actor->spr.xvel = 64 - bcos(actor->temp_data[1], -9);
actor->spr.ang += getincangle(actor->spr.ang, actor->spr.ang += getincangle(actor->spr.ang,
getangle(ps[p].pos.X - actor->int_pos().X, ps[p].pos.Y - actor->int_pos().Y)) >> 3; getangle(ps[p].__int_pos.X - actor->int_pos().X, ps[p].__int_pos.Y - actor->int_pos().Y)) >> 3;
// TJR // TJR
} }
@ -2711,7 +2709,7 @@ DETONATEB:
} }
} }
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0) 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].pos.X, ps[p].pos.Y, ps[p].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].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON]) if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON])
{ {
if (ud.coop >= 1 && Owner == actor) if (ud.coop >= 1 && Owner == actor)
@ -3257,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)) 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].pos.X, ps[screenpeek].pos.Y, ps[screenpeek].pos.Z, ps[screenpeek].cursector); 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);
if (rnd(192) && (actor->temp_data[2] & 1)) if (rnd(192) && (actor->temp_data[2] & 1))
{ {
@ -3509,7 +3507,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{ {
if (ps[playernum].newOwner != nullptr) 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].opos.X - actor->int_pos().X, ps[playernum].opos.Y - actor->int_pos().Y);
else goalang = getangle(ps[playernum].pos.X - actor->int_pos().X, ps[playernum].pos.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; angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0; if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif; actor->spr.ang += angdif;
@ -3522,7 +3520,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{ {
if (ps[playernum].newOwner != nullptr) 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].opos.X - actor->int_pos().X, ps[playernum].opos.Y - actor->int_pos().Y);
else goalang = getangle(ps[playernum].pos.X - actor->int_pos().X, ps[playernum].pos.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; angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0) if (angdif > -32 && angdif < 0)
{ {
@ -3543,8 +3541,8 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{ {
int newx, newy; int newx, newy;
newx = ps[playernum].pos.X + (ps[playernum].vel.X / 768); newx = ps[playernum].__int_pos.X + (ps[playernum].vel.X / 768);
newy = ps[playernum].pos.Y + (ps[playernum].vel.Y / 768); newy = ps[playernum].__int_pos.Y + (ps[playernum].vel.Y / 768);
goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y); goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2; angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0; if (angdif > -8 && angdif < 0) angdif = 0;
@ -3650,7 +3648,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
{ {
daxvel = -(1024 - xvel); daxvel = -(1024 - xvel);
angdif = getangle(ps[playernum].pos.X - actor->int_pos().X, ps[playernum].pos.Y - actor->int_pos().Y); angdif = getangle(ps[playernum].__int_pos.X - actor->int_pos().X, ps[playernum].__int_pos.Y - actor->int_pos().Y);
if (xvel < 512) if (xvel < 512)
{ {

View file

@ -1456,9 +1456,9 @@ void movetransports_r(void)
ps[p].transporter_hold = 13; ps[p].transporter_hold = 13;
} }
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = Owner->int_pos().X; 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].pos.Y = Owner->int_pos().Y; ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = Owner->int_pos().Y;
ps[p].opos.Z = ps[p].pos.Z = Owner->int_pos().Z - (gs.playerheight - (4 << 8)); ps[p].opos.Z = ps[p].__int_pos.Z = Owner->int_pos().Z - (gs.playerheight - (4 << 8));
ChangeActorSect(act2, Owner->sector()); ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(act2->sector()); ps[p].setCursector(act2->sector());
@ -1471,17 +1471,17 @@ void movetransports_r(void)
} }
else break; else break;
if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].pos.Z) < 6144) if (onfloorz == 0 && abs(act->int_pos().Z - ps[p].__int_pos.Z) < 6144)
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) || if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) ||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH))) (ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
{ {
ps[p].opos.X = ps[p].pos.X += Owner->int_pos().X - act->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y += Owner->int_pos().Y - act->int_pos().Y; ps[p].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)) if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
ps[p].pos.Z = Owner->int_pos().Z - 6144; ps[p].__int_pos.Z = Owner->int_pos().Z - 6144;
else ps[p].pos.Z = Owner->int_pos().Z + 6144; else ps[p].__int_pos.Z = Owner->int_pos().Z + 6144;
ps[p].opos.Z = ps[p].pos.Z; ps[p].opos.Z = ps[p].__int_pos.Z;
ChangeActorSect(act2, Owner->sector()); ChangeActorSect(act2, Owner->sector());
ps[p].setCursector(Owner->sector()); ps[p].setCursector(Owner->sector());
@ -1493,23 +1493,23 @@ void movetransports_r(void)
if (isRRRA()) if (isRRRA())
{ {
if (onfloorz && sectlotag == 160 && ps[p].pos.Z > (sectp->int_floorz() - (48 << 8))) if (onfloorz && sectlotag == 160 && ps[p].__int_pos.Z > (sectp->int_floorz() - (48 << 8)))
{ {
k = 2; k = 2;
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_ceilingz() + (7 << 8); Owner->sector()->int_ceilingz() + (7 << 8);
} }
if (onfloorz && sectlotag == 161 && ps[p].pos.Z < (sectp->int_ceilingz() + (6 << 8))) if (onfloorz && sectlotag == 161 && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
{ {
k = 2; k = 2;
if (ps[p].GetActor()->spr.extra <= 0) break; if (ps[p].GetActor()->spr.extra <= 0) break;
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_floorz() - (49 << 8); Owner->sector()->int_floorz() - (49 << 8);
} }
} }
if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].pos.Z > (sectp->int_floorz() - (6 << 8))) || if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].__int_pos.Z > (sectp->int_floorz() - (6 << 8))) ||
(onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].OnMotorcycle)) (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].OnMotorcycle))
{ {
if (ps[p].OnBoat) break; if (ps[p].OnBoat) break;
@ -1519,13 +1519,13 @@ void movetransports_r(void)
FX_StopAllSounds(); FX_StopAllSounds();
} }
S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor()); S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor());
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_ceilingz() + (7 << 8); Owner->sector()->int_ceilingz() + (7 << 8);
if (ps[p].OnMotorcycle) if (ps[p].OnMotorcycle)
ps[p].moto_underwater = 1; ps[p].moto_underwater = 1;
} }
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.Z < (sectp->int_ceilingz() + (6 << 8))) if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].__int_pos.Z < (sectp->int_ceilingz() + (6 << 8)))
{ {
k = 1; k = 1;
if (ps[p].GetActor()->spr.extra <= 0) break; if (ps[p].GetActor()->spr.extra <= 0) break;
@ -1535,14 +1535,14 @@ void movetransports_r(void)
} }
S_PlayActorSound(DUKE_GASP, ps[p].GetActor()); S_PlayActorSound(DUKE_GASP, ps[p].GetActor());
ps[p].opos.Z = ps[p].pos.Z = ps[p].opos.Z = ps[p].__int_pos.Z =
Owner->sector()->int_floorz() - (7 << 8); Owner->sector()->int_floorz() - (7 << 8);
} }
if (k == 1) if (k == 1)
{ {
ps[p].opos.X = ps[p].pos.X += Owner->int_pos().X - act->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y += Owner->int_pos().Y - act->int_pos().Y; ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
if (Owner->GetOwner() != Owner) if (Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2; ps[p].transporter_hold = -2;
@ -1555,8 +1555,8 @@ void movetransports_r(void)
} }
else if (isRRRA() && k == 2) else if (isRRRA() && k == 2)
{ {
ps[p].opos.X = ps[p].pos.X += Owner->int_pos().X - act->int_pos().X; ps[p].opos.X = ps[p].__int_pos.X += Owner->int_pos().X - act->int_pos().X;
ps[p].opos.Y = ps[p].pos.Y += Owner->int_pos().Y - act->int_pos().Y; ps[p].opos.Y = ps[p].__int_pos.Y += Owner->int_pos().Y - act->int_pos().Y;
if (Owner->GetOwner() != Owner) if (Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2; ps[p].transporter_hold = -2;
@ -2289,9 +2289,9 @@ void rr_specialstats()
if (act2->spr.picnum == RRTILE297) if (act2->spr.picnum == RRTILE297)
{ {
ps[p].angle.ang = buildang(act2->spr.ang); ps[p].angle.ang = buildang(act2->spr.ang);
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = act2->int_pos().X; 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].pos.Y = act2->int_pos().Y; ps[p].bobpos.Y = ps[p].opos.Y = ps[p].__int_pos.Y = act2->int_pos().Y;
ps[p].opos.Z = ps[p].pos.Z = act2->int_pos().Z - (36 << 8); ps[p].opos.Z = ps[p].__int_pos.Z = act2->int_pos().Z - (36 << 8);
auto pact = ps[p].GetActor(); auto pact = ps[p].GetActor();
ChangeActorSect(pact, act2->sector()); ChangeActorSect(pact, act2->sector());
ps[p].setCursector(pact->sector()); ps[p].setCursector(pact->sector());
@ -2494,7 +2494,7 @@ DETONATEB:
} }
} }
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0) 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].pos.X, ps[p].pos.Y, ps[p].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].__int_pos.X, ps[p].__int_pos.Y, ps[p].__int_pos.Z, ps[p].cursector))
if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON]) if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON])
if (actor->spr.pal == 0) if (actor->spr.pal == 0)
{ {
@ -3489,7 +3489,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{ {
if (ps[pnum].newOwner != nullptr) 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].opos.X - actor->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y);
else goalang = getangle(ps[pnum].pos.X - actor->int_pos().X, ps[pnum].pos.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; angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0; if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif; actor->spr.ang += angdif;
@ -3502,7 +3502,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{ {
if (ps[pnum].newOwner != nullptr) 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].opos.X - actor->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y);
else goalang = getangle(ps[pnum].pos.X - actor->int_pos().X, ps[pnum].pos.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; angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0) if (angdif > -32 && angdif < 0)
{ {
@ -3518,7 +3518,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{ {
if (ps[pnum].newOwner != nullptr) 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].opos.X - actor->int_pos().X, ps[pnum].opos.Y - actor->int_pos().Y) + 1024) & 2047;
else goalang = (getangle(ps[pnum].pos.X - actor->int_pos().X, ps[pnum].pos.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; angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
if (angdif > -32 && angdif < 0) if (angdif > -32 && angdif < 0)
{ {
@ -3584,8 +3584,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{ {
int newx, newy; int newx, newy;
newx = ps[pnum].pos.X + (ps[pnum].vel.X / 768); newx = ps[pnum].__int_pos.X + (ps[pnum].vel.X / 768);
newy = ps[pnum].pos.Y + (ps[pnum].vel.Y / 768); newy = ps[pnum].__int_pos.Y + (ps[pnum].vel.Y / 768);
goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y); goalang = getangle(newx - actor->int_pos().X, newy - actor->int_pos().Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2; angdif = getincangle(actor->spr.ang, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0; if (angdif > -8 && angdif < 0) angdif = 0;
@ -3685,7 +3685,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
{ {
daxvel = -(1024 - xvel); daxvel = -(1024 - xvel);
angdif = getangle(ps[pnum].pos.X - actor->int_pos().X, ps[pnum].pos.Y - actor->int_pos().Y); angdif = getangle(ps[pnum].__int_pos.X - actor->int_pos().X, ps[pnum].__int_pos.Y - actor->int_pos().Y);
if (xvel < 512) 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 (t->statnum == 99) continue;
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner()) 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].pos.X - ps[h->spr.yvel].opos.X, 16)); 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].pos.Y - ps[h->spr.yvel].opos.Y, 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].pos.Z, smoothratio)); t->set_int_z(interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
t->add_int_z(PHEIGHT_DUKE); t->add_int_z(PHEIGHT_DUKE);
} }
else if (!actorflag(h, SFLAG_NOINTERPOLATE)) 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 = int sqa =
getangle( getangle(
OwnerAc->int_pos().X - ps[screenpeek].pos.X, OwnerAc->int_pos().X - ps[screenpeek].__int_pos.X,
OwnerAc->int_pos().Y - ps[screenpeek].pos.Y); OwnerAc->int_pos().Y - ps[screenpeek].__int_pos.Y);
int sqb = int sqb =
getangle( getangle(
OwnerAc->int_pos().X - t->int_pos().X, 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()) if (h->GetOwner())
newtspr->set_int_z(ps[p].pos.Z - (12 << 8)); newtspr->set_int_z(ps[p].__int_pos.Z - (12 << 8));
else newtspr->set_int_z(h->int_pos().Z - (51 << 8)); else newtspr->set_int_z(h->int_pos().Z - (51 << 8));
if (ps[p].curr_weapon == HANDBOMB_WEAPON) 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(); daz = h->actor_int_floorz();
if ((h->int_pos().Z - daz) < (8 << 8) && ps[screenpeek].pos.Z < daz) if ((h->int_pos().Z - daz) < (8 << 8) && ps[screenpeek].__int_pos.Z < daz)
{ {
auto shadowspr = tsprites.newTSprite(); auto shadowspr = tsprites.newTSprite();
*shadowspr = *t; *shadowspr = *t;
@ -602,7 +602,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else else
{ {
// Alter the shadow's position so that it appears behind the sprite itself. // Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].pos.X, shadowspr->int_pos().Y - ps[screenpeek].pos.Y); int look = getangle(shadowspr->int_pos().X - ps[screenpeek].__int_pos.X, shadowspr->int_pos().Y - ps[screenpeek].__int_pos.Y);
shadowspr->add_int_x(bcos(look, -9)); shadowspr->add_int_x(bcos(look, -9));
shadowspr->add_int_y(bsin(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 (t->statnum == 99) continue;
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner()) 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].pos.X - ps[h->spr.yvel].opos.X, 16)); 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].pos.Y - ps[h->spr.yvel].opos.Y, 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].pos.Z, smoothratio)); t->set_int_z(interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
t->add_int_z(PHEIGHT_RR); t->add_int_z(PHEIGHT_RR);
h->spr.xrepeat = 24; h->spr.xrepeat = 24;
h->spr.yrepeat = 17; h->spr.yrepeat = 17;
@ -200,8 +200,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
{ {
int sqa = int sqa =
getangle( getangle(
OwnerAc->int_pos().X - ps[screenpeek].pos.X, OwnerAc->int_pos().X - ps[screenpeek].__int_pos.X,
OwnerAc->int_pos().Y - ps[screenpeek].pos.Y); OwnerAc->int_pos().Y - ps[screenpeek].__int_pos.Y);
int sqb = int sqb =
getangle( getangle(
OwnerAc->int_pos().X - t->int_pos().X, 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()) if (h->GetOwner())
newtspr->set_int_z(ps[p].pos.Z - (12 << 8)); newtspr->set_int_z(ps[p].__int_pos.Z - (12 << 8));
else newtspr->set_int_z(h->int_pos().Z - (51 << 8)); else newtspr->set_int_z(h->int_pos().Z - (51 << 8));
if (ps[p].curr_weapon == HANDBOMB_WEAPON) 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(); daz = h->actor_int_floorz();
if ((h->int_pos().Z - daz) < (8 << 8)) if ((h->int_pos().Z - daz) < (8 << 8))
if (ps[screenpeek].pos.Z < daz) if (ps[screenpeek].__int_pos.Z < daz)
{ {
auto shadowspr = tsprites.newTSprite(); auto shadowspr = tsprites.newTSprite();
*shadowspr = *t; *shadowspr = *t;
@ -760,7 +760,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else else
{ {
// Alter the shadow's position so that it appears behind the sprite itself. // Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].pos.X, shadowspr->int_pos().Y - ps[screenpeek].pos.Y); int look = getangle(shadowspr->int_pos().X - ps[screenpeek].__int_pos.X, shadowspr->int_pos().Y - ps[screenpeek].__int_pos.Y);
shadowspr->add_int_x(bcos(look, -9)); shadowspr->add_int_x(bcos(look, -9));
shadowspr->add_int_y(bsin(look, -9)); shadowspr->add_int_y(bsin(look, -9));
} }

View file

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

View file

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

View file

@ -326,15 +326,15 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break; 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. 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].pos.X, sActor, sPlayer); if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.X, sActor, sPlayer);
break; break;
case PLAYER_POSY: case PLAYER_POSY:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.Y, sActor, sPlayer); if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.Y, sActor, sPlayer);
break; break;
case PLAYER_POSZ: case PLAYER_POSZ:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.Z, sActor, sPlayer); if (!bSet) SetGameVarID(lVar2, ps[iPlayer].__int_pos.Z, sActor, sPlayer);
break; break;
case PLAYER_HORIZ: case PLAYER_HORIZ:
@ -1522,12 +1522,12 @@ int ParseState::parse(void)
parseifelse(ifcanshoottarget(g_ac, g_p, g_x)); parseifelse(ifcanshoottarget(g_ac, g_p, g_x));
break; break;
case concmd_ifcanseetarget: 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].pos.X, ps[g_p].pos.Y, ps[g_p].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].__int_pos.X, ps[g_p].__int_pos.Y, ps[g_p].__int_pos.Z/*-((krand()&41)<<8)*/, ps[g_p].GetActor()->sector());
parseifelse(j); parseifelse(j);
if (j) g_ac->timetosleep = SLEEPTIME; if (j) g_ac->timetosleep = SLEEPTIME;
break; break;
case concmd_ifnocover: 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].pos.X, ps[g_p].pos.Y, ps[g_p].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].__int_pos.X, ps[g_p].__int_pos.Y, ps[g_p].__int_pos.Z, ps[g_p].GetActor()->sector());
parseifelse(j); parseifelse(j);
if (j) g_ac->timetosleep = SLEEPTIME; if (j) g_ac->timetosleep = SLEEPTIME;
break; break;
@ -1981,8 +1981,8 @@ int ParseState::parse(void)
break; break;
case concmd_larrybird: case concmd_larrybird:
insptr++; insptr++;
ps[g_p].pos.Z = ps[g_p].GetActor()->sector()->int_ceilingz(); ps[g_p].__int_pos.Z = ps[g_p].GetActor()->sector()->int_ceilingz();
ps[g_p].GetActor()->set_int_z(ps[g_p].pos.Z); ps[g_p].GetActor()->set_int_z(ps[g_p].__int_pos.Z);
break; break;
case concmd_destroyit: case concmd_destroyit:
insptr++; insptr++;
@ -2047,11 +2047,11 @@ int ParseState::parse(void)
if(!isRR() && ps[g_p].newOwner != nullptr) if(!isRR() && ps[g_p].newOwner != nullptr)
{ {
ps[g_p].newOwner = nullptr; ps[g_p].newOwner = nullptr;
ps[g_p].pos.X = ps[g_p].opos.X; ps[g_p].__int_pos.X = ps[g_p].opos.X;
ps[g_p].pos.Y = ps[g_p].opos.Y; ps[g_p].__int_pos.Y = ps[g_p].opos.Y;
ps[g_p].pos.Z = ps[g_p].opos.Z; ps[g_p].__int_pos.Z = ps[g_p].opos.Z;
ps[g_p].angle.restore(); ps[g_p].angle.restore();
updatesector(ps[g_p].pos.X,ps[g_p].pos.Y,&ps[g_p].cursector); updatesector(ps[g_p].__int_pos.X,ps[g_p].__int_pos.Y,&ps[g_p].cursector);
DukeStatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
while (auto actj = it.Next()) 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.. // I am not convinced this is even remotely smart to be executed from here..
pickrandomspot(g_p); pickrandomspot(g_p);
g_ac->set_int_pos({ ps[g_p].bobpos.X = ps[g_p].opos.X = ps[g_p].pos.X, ps[g_p].bobpos.Y = ps[g_p].opos.Y = ps[g_p].pos.Y, ps[g_p].opos.Z = ps[g_p].pos.Z }); 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->backuppos(); g_ac->backuppos();
updatesector(ps[g_p].pos.X, ps[g_p].pos.Y, &ps[g_p].cursector); 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].pos.X, ps[g_p].pos.Y, ps[g_p].pos.Z + gs.playerheight }); 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 });
g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
g_ac->spr.shade = -12; g_ac->spr.shade = -12;
@ -2403,7 +2403,7 @@ int ParseState::parse(void)
j = 1; j = 1;
else if( (l& prunning) && s >= 8 && PlayerInput(g_p, SB_RUN) ) else if( (l& prunning) && s >= 8 && PlayerInput(g_p, SB_RUN) )
j = 1; j = 1;
else if( (l& phigher) && ps[g_p].pos.Z < (g_ac->int_pos().Z-(48<<8)) ) else if( (l& phigher) && ps[g_p].__int_pos.Z < (g_ac->int_pos().Z-(48<<8)) )
j = 1; j = 1;
else if( (l& pwalkingback) && s <= -8 && !(PlayerInput(g_p, SB_RUN)) ) else if( (l& pwalkingback) && s <= -8 && !(PlayerInput(g_p, SB_RUN)) )
j = 1; j = 1;
@ -2426,9 +2426,9 @@ int ParseState::parse(void)
else if( (l& pfacing) ) else if( (l& pfacing) )
{ {
if (g_ac->isPlayer() && ud.multimode > 1) if (g_ac->isPlayer() && ud.multimode > 1)
j = getincangle(ps[otherp].angle.ang.asbuild(), getangle(ps[g_p].pos.X - ps[otherp].pos.X, ps[g_p].pos.Y - ps[otherp].pos.Y)); 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));
else else
j = getincangle(ps[g_p].angle.ang.asbuild(), getangle(g_ac->int_pos().X - ps[g_p].pos.X, g_ac->int_pos().Y - ps[g_p].pos.Y)); 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));
if( j > -128 && j < 128 ) if( j > -128 && j < 128 )
j = 1; j = 1;
@ -2792,7 +2792,7 @@ int ParseState::parse(void)
case concmd_pstomp: case concmd_pstomp:
insptr++; insptr++;
if( ps[g_p].knee_incs == 0 && ps[g_p].GetActor()->spr.xrepeat >= (isRR()? 9: 40) ) 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].pos.X,ps[g_p].pos.Y,ps[g_p].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].__int_pos.X,ps[g_p].__int_pos.Y,ps[g_p].__int_pos.Z+(16<<8),ps[g_p].GetActor()->sector()) )
{ {
ps[g_p].knee_incs = 1; ps[g_p].knee_incs = 1;
if(ps[g_p].weapon_pos == 0) if(ps[g_p].weapon_pos == 0)

View file

@ -208,7 +208,7 @@ inline bool playrunning()
inline void doslopetilting(player_struct* p, double const scaleAdjust = 1) inline void doslopetilting(player_struct* p, double const scaleAdjust = 1)
{ {
bool const canslopetilt = p->on_ground && p->insector() && p->cursector->lotag != ST_2_UNDERWATER && (p->cursector->floorstat & CSTAT_SECTOR_SLOPE); bool const canslopetilt = p->on_ground && p->insector() && p->cursector->lotag != ST_2_UNDERWATER && (p->cursector->floorstat & CSTAT_SECTOR_SLOPE);
p->horizon.calcviewpitch(p->pos.vec2, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust); p->horizon.calcviewpitch(p->__int_pos.vec2, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View file

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

View file

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

View file

@ -215,10 +215,10 @@ int hitawall(struct player_struct* p, walltype** hitw)
{ {
HitInfo hit{}; HitInfo hit{};
hitscan(p->pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), 0 }, hit, CLIPMASK0); hitscan(p->__int_pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), 0 }, hit, CLIPMASK0);
if (hitw) *hitw = hit.hitWall; if (hitw) *hitw = hit.hitWall;
return (FindDistance2D(hit.hitpos.vec2 - p->pos.vec2)); return (FindDistance2D(hit.hitpos.vec2 - p->__int_pos.vec2));
} }
@ -252,7 +252,7 @@ DDukeActor* aim(DDukeActor* actor, int aang)
int zvel = -plr->horizon.sum().asq16() >> 5; int zvel = -plr->horizon.sum().asq16() >> 5;
HitInfo hit{}; HitInfo hit{};
hitscan(plr->pos.withZOffset(1024), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), zvel }, hit, CLIPMASK1); hitscan(plr->__int_pos.withZOffset(1024), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), zvel }, hit, CLIPMASK1);
if (hit.actor() != nullptr) if (hit.actor() != nullptr)
{ {
@ -511,8 +511,8 @@ void footprints(int snum)
while (auto act = it.Next()) 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 (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->pos.X) < 384) if (abs(act->int_pos().X - p->__int_pos.X) < 384)
if (abs(act->int_pos().Y - p->pos.Y) < 384) if (abs(act->int_pos().Y - p->__int_pos.Y) < 384)
{ {
j = 1; j = 1;
break; break;
@ -564,7 +564,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
if (actor->spr.pal != 1) if (actor->spr.pal != 1)
{ {
SetPlayerPal(p, PalEntry(63, 63, 0, 0)); SetPlayerPal(p, PalEntry(63, 63, 0, 0));
p->pos.Z -= (16 << 8); p->__int_pos.Z -= (16 << 8);
actor->add_int_z(-(16 << 8)); actor->add_int_z(-(16 << 8));
} }
#if 0 #if 0
@ -612,8 +612,8 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
{ {
if (p->on_warping_sector == 0) if (p->on_warping_sector == 0)
{ {
if (abs(p->pos.Z - fz) > (gs.playerheight >> 1)) if (abs(p->__int_pos.Z - fz) > (gs.playerheight >> 1))
p->pos.Z += 348; p->__int_pos.Z += 348;
} }
else else
{ {
@ -622,19 +622,19 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
} }
Collision coll; Collision coll;
clipmove(p->pos, &p->cursector, 0, 0, 164, (4 << 8), (4 << 8), CLIPMASK0, coll); clipmove(p->__int_pos, &p->cursector, 0, 0, 164, (4 << 8), (4 << 8), CLIPMASK0, coll);
} }
backupplayer(p); backupplayer(p);
p->horizon.horizoff = p->horizon.horiz = q16horiz(0); p->horizon.horizoff = p->horizon.horiz = q16horiz(0);
updatesector(p->pos.X, p->pos.Y, &p->cursector); updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
pushmove(&p->pos, &p->cursector, 128L, (4 << 8), (20 << 8), CLIPMASK0); pushmove(&p->__int_pos, &p->cursector, 128L, (4 << 8), (20 << 8), CLIPMASK0);
if (fz > cz + (16 << 8) && actor->spr.pal != 1) if (fz > cz + (16 << 8) && actor->spr.pal != 1)
p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->pos.Z) >> 7)); p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->__int_pos.Z) >> 7));
p->on_warping_sector = 0; p->on_warping_sector = 0;
@ -710,7 +710,7 @@ void playerCrouch(int snum)
OnEvent(EVENT_CROUCH, snum, p->GetActor(), -1); OnEvent(EVENT_CROUCH, snum, p->GetActor(), -1);
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
{ {
p->pos.Z += (2048 + 768); p->__int_pos.Z += (2048 + 768);
p->crack_time = CRACK_TIME; p->crack_time = CRACK_TIME;
} }
} }
@ -769,18 +769,18 @@ void player_struct::backuppos(bool noclipping)
{ {
if (!noclipping) if (!noclipping)
{ {
opos.X = pos.X; opos.X = __int_pos.X;
opos.Y = pos.Y; opos.Y = __int_pos.Y;
} }
else else
{ {
pos.X = opos.X; __int_pos.X = opos.X;
pos.Y = opos.Y; __int_pos.Y = opos.Y;
} }
opos.Z = pos.Z; opos.Z = __int_pos.Z;
bobpos.X = pos.X; bobpos.X = __int_pos.X;
bobpos.Y = pos.Y; bobpos.Y = __int_pos.Y;
opyoff = pyoff; opyoff = pyoff;
} }

View file

@ -382,7 +382,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
int x; int x;
int j = findplayer(actor, &x); int j = findplayer(actor, &x);
sz -= (4 << 8); sz -= (4 << 8);
zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
if (actor->spr.picnum != BOSS1) if (actor->spr.picnum != BOSS1)
{ {
zvel += 128 - (krand() & 255); zvel += 128 - (krand() & 255);
@ -391,7 +391,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
else else
{ {
zvel += 128 - (krand() & 255); zvel += 128 - (krand() & 255);
sa = getangle(ps[j].pos.X - sx, ps[j].pos.Y - sy) + 64 - (krand() & 127); sa = getangle(ps[j].__int_pos.X - sx, ps[j].__int_pos.Y - sy) + 64 - (krand() & 127);
} }
} }
@ -947,7 +947,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
int x; int x;
int j = findplayer(actor, &x); int j = findplayer(actor, &x);
sz -= (4 << 8); sz -= (4 << 8);
zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
zvel += 128 - (krand() & 255); zvel += 128 - (krand() & 255);
sa += 32 - (krand() & 63); sa += 32 - (krand() & 63);
} }
@ -1016,9 +1016,9 @@ void shoot_d(DDukeActor* actor, int atwith)
if (actor->isPlayer()) if (actor->isPlayer())
{ {
sx = ps[p].pos.X; sx = ps[p].__int_pos.X;
sy = ps[p].pos.Y; sy = ps[p].__int_pos.Y;
sz = ps[p].pos.Z + ps[p].pyoff + (4 << 8); sz = ps[p].__int_pos.Z + ps[p].pyoff + (4 << 8);
sa = ps[p].angle.ang.asbuild(); sa = ps[p].angle.ang.asbuild();
ps[p].crack_time = CRACK_TIME; ps[p].crack_time = CRACK_TIME;
@ -1687,7 +1687,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
if (p->jetpack_on < 11) if (p->jetpack_on < 11)
{ {
p->jetpack_on++; p->jetpack_on++;
p->pos.Z -= (p->jetpack_on << 7); //Goin up p->__int_pos.Z -= (p->jetpack_on << 7); //Goin up
} }
else if (p->jetpack_on == 11 && !S_CheckActorSoundPlaying(pact, DUKE_JETPACK_IDLE)) else if (p->jetpack_on == 11 && !S_CheckActorSoundPlaying(pact, DUKE_JETPACK_IDLE))
S_PlayActorSound(DUKE_JETPACK_IDLE, pact); S_PlayActorSound(DUKE_JETPACK_IDLE, pact);
@ -1702,7 +1702,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
OnEvent(EVENT_SOARUP, snum, p->GetActor(), -1); OnEvent(EVENT_SOARUP, snum, p->GetActor(), -1);
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
{ {
p->pos.Z -= j; p->__int_pos.Z -= j;
p->crack_time = CRACK_TIME; p->crack_time = CRACK_TIME;
} }
} }
@ -1714,7 +1714,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
OnEvent(EVENT_SOARDOWN, snum, p->GetActor(), -1); OnEvent(EVENT_SOARDOWN, snum, p->GetActor(), -1);
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
{ {
p->pos.Z += j; p->__int_pos.Z += j;
p->crack_time = CRACK_TIME; p->crack_time = CRACK_TIME;
} }
} }
@ -1726,10 +1726,10 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
if (psectlotag != 2 && p->scuba_on == 1) if (psectlotag != 2 && p->scuba_on == 1)
p->scuba_on = 0; p->scuba_on = 0;
if (p->pos.Z > (fz - (k << 8))) if (p->__int_pos.Z > (fz - (k << 8)))
p->pos.Z += ((fz - (k << 8)) - p->pos.Z) >> 1; p->__int_pos.Z += ((fz - (k << 8)) - p->__int_pos.Z) >> 1;
if (p->pos.Z < (pact->actor_int_ceilingz() + (18 << 8))) if (p->__int_pos.Z < (pact->actor_int_ceilingz() + (18 << 8)))
p->pos.Z = pact->actor_int_ceilingz() + (18 << 8); p->__int_pos.Z = pact->actor_int_ceilingz() + (18 << 8);
} }
@ -1783,12 +1783,12 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
footprints(snum); footprints(snum);
} }
if (p->pos.Z < (fz - (i << 8))) //falling if (p->__int_pos.Z < (fz - (i << 8))) //falling
{ {
// not jumping or crouching // not jumping or crouching
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.Z >= (fz - (i << 8) - (16 << 8))) if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->__int_pos.Z >= (fz - (i << 8) - (16 << 8)))
p->pos.Z = fz - (i << 8); p->__int_pos.Z = fz - (i << 8);
else else
{ {
p->on_ground = 0; p->on_ground = 0;
@ -1801,7 +1801,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
S_PlayActorSound(DUKE_SCREAM, pact); S_PlayActorSound(DUKE_SCREAM, pact);
} }
if ((p->pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground if ((p->__int_pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
{ {
S_StopSound(DUKE_SCREAM, pact); S_StopSound(DUKE_SCREAM, pact);
if (!p->insector() || p->cursector->lotag != 1) if (!p->insector() || p->cursector->lotag != 1)
@ -1845,18 +1845,18 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
{ {
//Smooth on the ground //Smooth on the ground
int k = ((fz - (i << 8)) - p->pos.Z) >> 1; int k = ((fz - (i << 8)) - p->__int_pos.Z) >> 1;
if (abs(k) < 256) k = 0; if (abs(k) < 256) k = 0;
p->pos.Z += k; p->__int_pos.Z += k;
p->vel.Z -= 768; p->vel.Z -= 768;
if (p->vel.Z < 0) p->vel.Z = 0; if (p->vel.Z < 0) p->vel.Z = 0;
} }
else if (p->jumping_counter == 0) else if (p->jumping_counter == 0)
{ {
p->pos.Z += ((fz - (i << 7)) - p->pos.Z) >> 1; //Smooth on the water p->__int_pos.Z += ((fz - (i << 7)) - p->__int_pos.Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->pos.Z > fz - (16 << 8)) if (p->on_warping_sector == 0 && p->__int_pos.Z > fz - (16 << 8))
{ {
p->pos.Z = fz - (16 << 8); p->__int_pos.Z = fz - (16 << 8);
p->vel.Z >>= 1; p->vel.Z >>= 1;
} }
} }
@ -1907,15 +1907,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
} }
} }
p->pos.Z += p->vel.Z; p->__int_pos.Z += p->vel.Z;
if (p->pos.Z < (cz + (4 << 8))) if (p->__int_pos.Z < (cz + (4 << 8)))
{ {
p->jumping_counter = 0; p->jumping_counter = 0;
if (p->vel.Z < 0) if (p->vel.Z < 0)
p->vel.X = p->vel.Y = 0; p->vel.X = p->vel.Y = 0;
p->vel.Z = 128; p->vel.Z = 128;
p->pos.Z = cz + (4 << 8); p->__int_pos.Z = cz + (4 << 8);
} }
} }
@ -1974,14 +1974,14 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
if (p->vel.Z > 2048) if (p->vel.Z > 2048)
p->vel.Z >>= 1; p->vel.Z >>= 1;
p->pos.Z += p->vel.Z; p->__int_pos.Z += p->vel.Z;
if (p->pos.Z > (fz - (15 << 8))) if (p->__int_pos.Z > (fz - (15 << 8)))
p->pos.Z += ((fz - (15 << 8)) - p->pos.Z) >> 1; p->__int_pos.Z += ((fz - (15 << 8)) - p->__int_pos.Z) >> 1;
if (p->pos.Z < (cz + (4 << 8))) if (p->__int_pos.Z < (cz + (4 << 8)))
{ {
p->pos.Z = cz + (4 << 8); p->__int_pos.Z = cz + (4 << 8);
p->vel.Z = 0; 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->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.xrepeat = 3;
j->spr.yrepeat = 2; j->spr.yrepeat = 2;
j->set_int_z(p->pos.Z + (8 << 8)); j->set_int_z(p->__int_pos.Z + (8 << 8));
} }
} }
} }
@ -2009,7 +2009,7 @@ int operateTripbomb(int snum)
auto p = &ps[snum]; auto p = &ps[snum];
HitInfo hit{}; HitInfo hit{};
hitscan(p->pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), -p->horizon.sum().asq16() >> 11 }, hit, CLIPMASK1); hitscan(p->__int_pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), -p->horizon.sum().asq16() >> 11 }, hit, CLIPMASK1);
if (hit.hitSector == nullptr || hit.actor()) if (hit.hitSector == nullptr || hit.actor())
return 0; return 0;
@ -2032,9 +2032,9 @@ int operateTripbomb(int snum)
if (act == nullptr && hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) 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.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2))
if (((hit.hitpos.X - p->pos.X) * (hit.hitpos.X - p->pos.X) + (hit.hitpos.Y - p->pos.Y) * (hit.hitpos.Y - p->pos.Y)) < (290 * 290)) 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->pos.Z = p->opos.Z; p->__int_pos.Z = p->opos.Z;
p->vel.Z = 0; p->vel.Z = 0;
return 1; return 1;
} }
@ -2199,9 +2199,9 @@ static void operateweapon(int snum, ESyncBits actions)
} }
auto spawned = EGS(p->cursector, auto spawned = EGS(p->cursector,
p->pos.X + p->angle.ang.bcos(-6), p->__int_pos.X + p->angle.ang.bcos(-6),
p->pos.Y + p->angle.ang.bsin(-6), p->__int_pos.Y + p->angle.ang.bsin(-6),
p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, pact, 1); p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, pact, 1);
if (isNam()) if (isNam())
@ -2572,7 +2572,7 @@ static void operateweapon(int snum, ESyncBits actions)
case TRIPBOMB_WEAPON: // Claymore in NAM case TRIPBOMB_WEAPON: // Claymore in NAM
if (p->kickback_pic < 4) if (p->kickback_pic < 4)
{ {
p->pos.Z = p->opos.Z; p->__int_pos.Z = p->opos.Z;
p->vel.Z = 0; p->vel.Z = 0;
if (p->kickback_pic == 3) if (p->kickback_pic == 3)
fi.shoot(pact, HANDHOLDINGLASER); fi.shoot(pact, HANDHOLDINGLASER);
@ -2736,14 +2736,14 @@ void processinput_d(int snum)
p->spritebridge = 0; p->spritebridge = 0;
shrunk = (pact->spr.yrepeat < 32); shrunk = (pact->spr.yrepeat < 32);
getzrange(p->pos, psectp, &cz, chz, &fz, clz, 163, CLIPMASK0); getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 163, CLIPMASK0);
j = getflorzofslopeptr(psectp, p->pos.X, p->pos.Y); j = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
p->truefz = j * zinttoworld; p->truefz = j * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->pos.X, p->pos.Y) * zinttoworld; p->truecz = getceilzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y) * zinttoworld;
truefdist = abs(p->pos.Z - j); truefdist = abs(p->__int_pos.Z - j);
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8)) if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
psectlotag = 0; 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)) 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->pos.X, clz.actor()->int_pos().Y - p->pos.Y); j = getangle(clz.actor()->int_pos().X - p->__int_pos.X, clz.actor()->int_pos().Y - p->__int_pos.Y);
p->vel.X -= bcos(j, 4); p->vel.X -= bcos(j, 4);
p->vel.Y -= bsin(j, 4); p->vel.Y -= bsin(j, 4);
} }
@ -2855,7 +2855,7 @@ void processinput_d(int snum)
p->playerweaponsway(pact->spr.xvel); p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobpos.Y) * (p->pos.Y - p->bobpos.Y)), 0, 512); 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);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1; if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector())); p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector()));
@ -3026,16 +3026,16 @@ HORIZONLY:
Collision clip{}; Collision clip{};
if (ud.clipping) if (ud.clipping)
{ {
p->pos.X += p->vel.X >> 14; p->__int_pos.X += p->vel.X >> 14;
p->pos.Y += p->vel.Y >> 14; p->__int_pos.Y += p->vel.Y >> 14;
updatesector(p->pos.X, p->pos.Y, &p->cursector); updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
ChangeActorSect(pact, p->cursector); ChangeActorSect(pact, p->cursector);
} }
else else
clipmove(p->pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), ii, CLIPMASK0, clip); clipmove(p->__int_pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), ii, CLIPMASK0, clip);
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk) if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
p->pos.Z += 32 << 8; p->__int_pos.Z += 32 << 8;
if (clip.type != kHitNone) if (clip.type != kHitNone)
checkplayerhurt_d(p, clip); checkplayerhurt_d(p, clip);
@ -3056,7 +3056,7 @@ HORIZONLY:
} }
// RBG*** // RBG***
SetActor(pact, { p->pos.X, p->pos.Y, p->pos.Z + gs.playerheight }); SetActor(pact, { p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + gs.playerheight });
if (psectlotag < 3) if (psectlotag < 3)
{ {
@ -3083,7 +3083,7 @@ HORIZONLY:
while (ud.clipping == 0) while (ud.clipping == 0)
{ {
int blocked; int blocked;
blocked = (pushmove(&p->pos, &p->cursector, 164, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512); blocked = (pushmove(&p->__int_pos, &p->cursector, 164, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512);
if (fabs(pact->floorz - pact->ceilingz) < 48 || blocked) if (fabs(pact->floorz - pact->ceilingz) < 48 || blocked)
{ {
@ -3094,7 +3094,7 @@ HORIZONLY:
{ {
if (!retry++) if (!retry++)
{ {
p->pos = p->opos = oldpos; p->__int_pos = p->opos = oldpos;
continue; continue;
} }
quickkill(p); quickkill(p);

View file

@ -244,7 +244,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
int x; int x;
int j = findplayer(actor, &x); int j = findplayer(actor, &x);
sz -= (4 << 8); sz -= (4 << 8);
zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); zvel = ((ps[j].__int_pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor));
if (actor->spr.picnum != BOSS1) if (actor->spr.picnum != BOSS1)
{ {
zvel += 128 - (krand() & 255); zvel += 128 - (krand() & 255);
@ -253,7 +253,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
else else
{ {
zvel += 128 - (krand() & 255); zvel += 128 - (krand() & 255);
sa = getangle(ps[j].pos.X - sx, ps[j].pos.Y - sy) + 64 - (krand() & 127); sa = getangle(ps[j].__int_pos.X - sx, ps[j].__int_pos.Y - sy) + 64 - (krand() & 127);
} }
} }
@ -835,9 +835,9 @@ void shoot_r(DDukeActor* actor, int atwith)
{ {
p = actor->spr.yvel; p = actor->spr.yvel;
sx = ps[p].pos.X; sx = ps[p].__int_pos.X;
sy = ps[p].pos.Y; sy = ps[p].__int_pos.Y;
sz = ps[p].pos.Z + ps[p].pyoff + (4 << 8); sz = ps[p].__int_pos.Z + ps[p].pyoff + (4 << 8);
sa = ps[p].angle.ang.asbuild(); sa = ps[p].angle.ang.asbuild();
if (isRRRA()) ps[p].crack_time = CRACK_TIME; 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); footprints(snum);
} }
if (p->pos.Z < (fz - (i << 8))) //falling if (p->__int_pos.Z < (fz - (i << 8))) //falling
{ {
if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.Z >= (fz - (i << 8) - (16 << 8))) if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->__int_pos.Z >= (fz - (i << 8) - (16 << 8)))
p->pos.Z = fz - (i << 8); p->__int_pos.Z = fz - (i << 8);
else else
{ {
p->on_ground = 0; p->on_ground = 0;
if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->pos.Z) if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->__int_pos.Z)
{ {
if (p->MotoOnGround) if (p->MotoOnGround)
{ {
@ -2153,7 +2153,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
S_PlayActorSound(DUKE_SCREAM, pact); S_PlayActorSound(DUKE_SCREAM, pact);
} }
if ((p->pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground if ((p->__int_pos.Z + p->vel.Z) >= (fz - (i << 8))) // hit the ground
{ {
S_StopSound(DUKE_SCREAM, pact); S_StopSound(DUKE_SCREAM, pact);
if (!p->insector() || p->cursector->lotag != 1) if (!p->insector() || p->cursector->lotag != 1)
@ -2213,18 +2213,18 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
{ {
//Smooth on the ground //Smooth on the ground
int k = ((fz - (i << 8)) - p->pos.Z) >> 1; int k = ((fz - (i << 8)) - p->__int_pos.Z) >> 1;
if (abs(k) < 256) k = 0; if (abs(k) < 256) k = 0;
p->pos.Z += k; p->__int_pos.Z += k;
p->vel.Z -= 768; p->vel.Z -= 768;
if (p->vel.Z < 0) p->vel.Z = 0; if (p->vel.Z < 0) p->vel.Z = 0;
} }
else if (p->jumping_counter == 0) else if (p->jumping_counter == 0)
{ {
p->pos.Z += ((fz - (i << 7)) - p->pos.Z) >> 1; //Smooth on the water p->__int_pos.Z += ((fz - (i << 7)) - p->__int_pos.Z) >> 1; //Smooth on the water
if (p->on_warping_sector == 0 && p->pos.Z > fz - (16 << 8)) if (p->on_warping_sector == 0 && p->__int_pos.Z > fz - (16 << 8))
{ {
p->pos.Z = fz - (16 << 8); p->__int_pos.Z = fz - (16 << 8);
p->vel.Z >>= 1; p->vel.Z >>= 1;
} }
} }
@ -2271,15 +2271,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
} }
} }
p->pos.Z += p->vel.Z; p->__int_pos.Z += p->vel.Z;
if (p->pos.Z < (cz + (4 << 8))) if (p->__int_pos.Z < (cz + (4 << 8)))
{ {
p->jumping_counter = 0; p->jumping_counter = 0;
if (p->vel.Z < 0) if (p->vel.Z < 0)
p->vel.X = p->vel.Y = 0; p->vel.X = p->vel.Y = 0;
p->vel.Z = 128; p->vel.Z = 128;
p->pos.Z = cz + (4 << 8); p->__int_pos.Z = cz + (4 << 8);
} }
} }
@ -2334,14 +2334,14 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
if (p->vel.Z > 2048) if (p->vel.Z > 2048)
p->vel.Z >>= 1; p->vel.Z >>= 1;
p->pos.Z += p->vel.Z; p->__int_pos.Z += p->vel.Z;
if (p->pos.Z > (fz - (15 << 8))) if (p->__int_pos.Z > (fz - (15 << 8)))
p->pos.Z += ((fz - (15 << 8)) - p->pos.Z) >> 1; p->__int_pos.Z += ((fz - (15 << 8)) - p->__int_pos.Z) >> 1;
if (p->pos.Z < (cz + (4 << 8))) if (p->__int_pos.Z < (cz + (4 << 8)))
{ {
p->pos.Z = cz + (4 << 8); p->__int_pos.Z = cz + (4 << 8);
p->vel.Z = 0; 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->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.xrepeat = 3;
j->spr.yrepeat = 2; j->spr.yrepeat = 2;
j->set_int_z(p->pos.Z + (8 << 8)); j->set_int_z(p->__int_pos.Z + (8 << 8));
j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT; 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, auto spawned = EGS(p->cursector,
p->pos.X + p->angle.ang.bcos(-6), p->__int_pos.X + p->angle.ang.bcos(-6),
p->pos.Y + p->angle.ang.bsin(-6), p->__int_pos.Y + p->angle.ang.bsin(-6),
p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)) * 2, i, pact, 1); p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)) * 2, i, pact, 1);
if (spawned) if (spawned)
@ -3161,9 +3161,9 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
} }
EGS(p->cursector, EGS(p->cursector,
p->pos.X + p->angle.ang.bcos(-6), p->__int_pos.X + p->angle.ang.bcos(-6),
p->pos.Y + p->angle.ang.bsin(-6), p->__int_pos.Y + p->angle.ang.bsin(-6),
p->pos.Z, POWDERKEG, -16, 9, 9, p->__int_pos.Z, POWDERKEG, -16, 9, 9,
p->angle.ang.asbuild(), k * 2, i, pact, 1); p->angle.ang.asbuild(), k * 2, i, pact, 1);
} }
p->kickback_pic++; p->kickback_pic++;
@ -3380,7 +3380,7 @@ void processinput_r(int snum)
while (auto act2 = it.Next()) while (auto act2 = it.Next())
{ {
if (act2->spr.picnum == RRTILE380) if (act2->spr.picnum == RRTILE380)
if (act2->int_pos().Z - (8 << 8) < p->pos.Z) if (act2->int_pos().Z - (8 << 8) < p->__int_pos.Z)
psectlotag = 2; psectlotag = 2;
} }
} }
@ -3401,19 +3401,19 @@ void processinput_r(int snum)
int tempfz; int tempfz;
if (pact->spr.clipdist == 64) if (pact->spr.clipdist == 64)
{ {
getzrange(p->pos, psectp, &cz, chz, &fz, clz, 163L, CLIPMASK0); getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 163L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->pos.X, p->pos.Y); tempfz = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
} }
else else
{ {
getzrange(p->pos, psectp, &cz, chz, &fz, clz, 4L, CLIPMASK0); getzrange(p->__int_pos, psectp, &cz, chz, &fz, clz, 4L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->pos.X, p->pos.Y); tempfz = getflorzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y);
} }
p->truefz = tempfz * zinttoworld; p->truefz = tempfz * zinttoworld;
p->truecz = getceilzofslopeptr(psectp, p->pos.X, p->pos.Y) * zinttoworld; p->truecz = getceilzofslopeptr(psectp, p->__int_pos.X, p->__int_pos.Y) * zinttoworld;
truefdist = abs(p->pos.Z - tempfz); truefdist = abs(p->__int_pos.Z - tempfz);
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8)) if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
psectlotag = 0; 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)) 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->pos.X, clz.actor()->int_pos().Y - p->pos.Y); int j = getangle(clz.actor()->int_pos().X - p->__int_pos.X, clz.actor()->int_pos().Y - p->__int_pos.Y);
p->vel.X -= bcos(j, 4); p->vel.X -= bcos(j, 4);
p->vel.Y -= bsin(j, 4); p->vel.Y -= bsin(j, 4);
} }
@ -3580,7 +3580,7 @@ void processinput_r(int snum)
p->playerweaponsway(pact->spr.xvel); p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobpos.Y) * (p->pos.Y - p->bobpos.Y)), 0, 512); 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);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1; if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector())); p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floorpicnum == MIRROR) || !p->insector()));
@ -3795,16 +3795,16 @@ HORIZONLY:
Collision clip{}; Collision clip{};
if (ud.clipping) if (ud.clipping)
{ {
p->pos.X += p->vel.X >> 14; p->__int_pos.X += p->vel.X >> 14;
p->pos.Y += p->vel.Y >> 14; p->__int_pos.Y += p->vel.Y >> 14;
updatesector(p->pos.X, p->pos.Y, &p->cursector); updatesector(p->__int_pos.X, p->__int_pos.Y, &p->cursector);
ChangeActorSect(pact, p->cursector); ChangeActorSect(pact, p->cursector);
} }
else else
clipmove(p->pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), i, CLIPMASK0, clip); clipmove(p->__int_pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), i, CLIPMASK0, clip);
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk) if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
p->pos.Z += 32 << 8; p->__int_pos.Z += 32 << 8;
if (clip.type != kHitNone) if (clip.type != kHitNone)
checkplayerhurt_r(p, clip); checkplayerhurt_r(p, clip);
@ -3830,10 +3830,10 @@ HORIZONLY:
if (wal->lotag < 44) if (wal->lotag < 44)
{ {
dofurniture(clip.hitWall, p->cursector, snum); dofurniture(clip.hitWall, p->cursector, snum);
pushmove(&p->pos, &p->cursector, 172L, (4L << 8), (4L << 8), CLIPMASK0); pushmove(&p->__int_pos, &p->cursector, 172L, (4L << 8), (4L << 8), CLIPMASK0);
} }
else else
pushmove(&p->pos, &p->cursector, 172L, (4L << 8), (4L << 8), CLIPMASK0); pushmove(&p->__int_pos, &p->cursector, 172L, (4L << 8), (4L << 8), CLIPMASK0);
} }
} }
} }
@ -3898,7 +3898,7 @@ HORIZONLY:
} }
// RBG*** // RBG***
SetActor(pact, { p->pos.X, p->pos.Y, p->pos.Z + gs.playerheight }); SetActor(pact, { p->__int_pos.X, p->__int_pos.Y, p->__int_pos.Z + gs.playerheight });
if (psectlotag == 800 && (!isRRRA() || !p->lotag800kill)) if (psectlotag == 800 && (!isRRRA() || !p->lotag800kill))
{ {
@ -3934,9 +3934,9 @@ HORIZONLY:
{ {
int blocked; int blocked;
if (pact->spr.clipdist == 64) if (pact->spr.clipdist == 64)
blocked = (pushmove(&p->pos, &p->cursector, 128, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512); blocked = (pushmove(&p->__int_pos, &p->cursector, 128, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512);
else else
blocked = (pushmove(&p->pos, &p->cursector, 16, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512); blocked = (pushmove(&p->__int_pos, &p->cursector, 16, (4 << 8), (4 << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512);
if (fabs(pact->floorz - pact->ceilingz) < 48 || blocked) if (fabs(pact->floorz - pact->ceilingz) < 48 || blocked)
{ {
@ -3947,7 +3947,7 @@ HORIZONLY:
{ {
if (!retry++) if (!retry++)
{ {
p->pos = p->opos = oldpos; p->__int_pos = p->opos = oldpos;
continue; continue;
} }
quickkill(p); quickkill(p);
@ -4047,8 +4047,8 @@ void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
{ {
if (motosprite) if (motosprite)
{ {
p->pos.X = motosprite->int_pos().X; p->__int_pos.X = motosprite->int_pos().X;
p->pos.Y = motosprite->int_pos().Y; p->__int_pos.Y = motosprite->int_pos().Y;
p->angle.ang = buildang(motosprite->spr.ang); p->angle.ang = buildang(motosprite->spr.ang);
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo; p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
deletesprite(motosprite); deletesprite(motosprite);
@ -4127,8 +4127,8 @@ void OnBoat(struct player_struct *p, DDukeActor* boat)
{ {
if (boat) if (boat)
{ {
p->pos.X = boat->int_pos().X; p->__int_pos.X = boat->int_pos().X;
p->pos.Y = boat->int_pos().Y; p->__int_pos.Y = boat->int_pos().Y;
p->angle.ang = buildang(boat->spr.ang); p->angle.ang = buildang(boat->spr.ang);
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo; p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
deletesprite(boat); deletesprite(boat);

View file

@ -342,9 +342,9 @@ void operateweapon_ww(int snum, ESyncBits actions)
} }
auto j = EGS(p->cursector, auto j = EGS(p->cursector,
p->pos.X + p->angle.ang.bcos(-6), p->__int_pos.X + p->angle.ang.bcos(-6),
p->pos.Y + p->angle.ang.bsin(-6), p->__int_pos.Y + p->angle.ang.bsin(-6),
p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->__int_pos.Z, HEAVYHBOMB, -16, 9, 9,
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, p->GetActor(), 1); p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, p->GetActor(), 1);
if (j) if (j)
@ -439,7 +439,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL
&& p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1)) && p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1))
{ {
p->pos.Z = p->opos.Z; p->__int_pos.Z = p->opos.Z;
p->vel.Z = 0; p->vel.Z = 0;
} }
if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum)) if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum))

View file

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

View file

@ -95,9 +95,9 @@ void pickrandomspot(int snum)
i = krand()%numplayersprites; i = krand()%numplayersprites;
else i = snum; else i = snum;
p->bobpos.X = p->opos.X = p->pos.X = po[i].opos.X; p->bobpos.X = p->opos.X = p->__int_pos.X = po[i].opos.X;
p->bobpos.Y = p->opos.Y = p->pos.Y = po[i].opos.Y; p->bobpos.Y = p->opos.Y = p->__int_pos.Y = po[i].opos.Y;
p->opos.Z = p->pos.Z = po[i].opos.Z; p->opos.Z = p->__int_pos.Z = po[i].opos.Z;
p->angle.oang = p->angle.ang = buildang(po[i].oa); p->angle.oang = p->angle.ang = buildang(po[i].oa);
p->setCursector(po[i].os); p->setCursector(po[i].os);
} }
@ -541,7 +541,7 @@ void resetpspritevars(int g)
int aimmode[MAXPLAYERS]; int aimmode[MAXPLAYERS];
STATUSBARTYPE tsbar[MAXPLAYERS]; STATUSBARTYPE tsbar[MAXPLAYERS];
EGS(ps[0].cursector, ps[0].pos.X, ps[0].pos.Y, ps[0].pos.Z, EGS(ps[0].cursector, ps[0].__int_pos.X, ps[0].__int_pos.Y, ps[0].__int_pos.Z,
TILE_APLAYER, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, nullptr, 10); TILE_APLAYER, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, nullptr, 10);
if (ud.recstat != 2) for (i = 0; i < MAXPLAYERS; i++) if (ud.recstat != 2) for (i = 0; i < MAXPLAYERS; i++)
@ -611,8 +611,8 @@ void resetpspritevars(int g)
if (numplayersprites == 0) if (numplayersprites == 0)
{ {
firstx = ps[0].pos.X; firstx = ps[0].__int_pos.X;
firsty = ps[0].pos.Y; firsty = ps[0].__int_pos.Y;
} }
po[numplayersprites].opos.X = act->int_pos().X; po[numplayersprites].opos.X = act->int_pos().X;
@ -659,9 +659,9 @@ void resetpspritevars(int g)
ps[j].frag_ps = j; ps[j].frag_ps = j;
act->SetOwner(act); act->SetOwner(act);
ps[j].bobpos.X = ps[j].opos.X = ps[j].pos.X = act->int_pos().X; 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].pos.Y = act->int_pos().Y; ps[j].bobpos.Y = ps[j].opos.Y = ps[j].__int_pos.Y = act->int_pos().Y;
ps[j].opos.Z = ps[j].pos.Z = act->int_pos().Z; ps[j].opos.Z = ps[j].__int_pos.Z = act->int_pos().Z;
act->backuppos(); act->backuppos();
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang); ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang);
@ -1005,7 +1005,7 @@ static int LoadTheMap(MapRecord *mi, struct player_struct *p, int gamemode)
currentLevel = mi; currentLevel = mi;
int sect; int sect;
SpawnSpriteDef sprites; SpawnSpriteDef sprites;
loadMap(mi->fileName, isShareware(), &p->pos, &lbang, &sect, sprites); loadMap(mi->fileName, isShareware(), &p->__int_pos, &lbang, &sect, sprites);
p->cursector = &sector[sect]; p->cursector = &sector[sect];
SECRET_SetMapName(mi->DisplayName(), mi->name); SECRET_SetMapName(mi->DisplayName(), mi->name);

View file

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

View file

@ -107,9 +107,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
{ {
if (arc.BeginObject(keyname)) if (arc.BeginObject(keyname))
{ {
arc("posx", w.pos.X) arc("posx", w.__int_pos.X)
("posy", w.pos.Y) ("posy", w.__int_pos.Y)
("posz", w.pos.Z) ("posz", w.__int_pos.Z)
("angle", w.angle) ("angle", w.angle)
("horizon", w.horizon) ("horizon", w.horizon)
.Array("gotweapon", w.gotweapon, MAX_WEAPONS) .Array("gotweapon", w.gotweapon, MAX_WEAPONS)
@ -277,9 +277,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
.EndObject(); .EndObject();
w.invdisptime = 0; w.invdisptime = 0;
w.opos.X = w.pos.X; w.opos.X = w.__int_pos.X;
w.opos.Y = w.pos.Y; w.opos.Y = w.__int_pos.Y;
w.opos.Z = w.pos.Z; w.opos.Z = w.__int_pos.Z;
w.opyoff = w.pyoff; w.opyoff = w.pyoff;
w.backupweapon(); w.backupweapon();
w.sync.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve. w.sync.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.

View file

@ -265,7 +265,7 @@ int findotherplayer(int p, int* d)
for (j = connecthead; j >= 0; j = connectpoint2[j]) for (j = connecthead; j >= 0; j = connectpoint2[j])
if (p != j && ps[j].GetActor()->spr.extra > 0) if (p != j && ps[j].GetActor()->spr.extra > 0)
{ {
x = abs(ps[j].opos.X - ps[p].pos.X) + abs(ps[j].opos.Y - ps[p].pos.Y) + (abs(ps[j].opos.Z - ps[p].pos.Z) >> 4); 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);
if (x < closest) if (x < closest)
{ {
@ -388,10 +388,10 @@ void doanimations(void)
{ {
for (p = connecthead; p >= 0; p = connectpoint2[p]) for (p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].cursector == dasectp) if (ps[p].cursector == dasectp)
if ((dasectp->int_floorz() - ps[p].pos.Z) < (64 << 8)) if ((dasectp->int_floorz() - ps[p].__int_pos.Z) < (64 << 8))
if (ps[p].GetActor()->GetOwner() != nullptr) if (ps[p].GetActor()->GetOwner() != nullptr)
{ {
ps[p].pos.Z += v; ps[p].__int_pos.Z += v;
ps[p].vel.Z = 0; ps[p].vel.Z = 0;
} }

View file

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

View file

@ -681,7 +681,7 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
setnextmap(false); setnextmap(false);
} }
vec3_t v = { sx, sy, ps[snum].pos.Z }; vec3_t v = { sx, sy, ps[snum].__int_pos.Z };
switch (picnum) switch (picnum)
{ {
default: default:
@ -1409,9 +1409,9 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
case BIGFORCE: case BIGFORCE:
p->hurt_delay = 26; p->hurt_delay = 26;
fi.checkhitwall(p->GetActor(), wal, fi.checkhitwall(p->GetActor(), wal,
p->pos.X + p->angle.ang.bcos(-9), p->__int_pos.X + p->angle.ang.bcos(-9),
p->pos.Y + p->angle.ang.bsin(-9), p->__int_pos.Y + p->angle.ang.bsin(-9),
p->pos.Z, -1); p->__int_pos.Z, -1);
break; break;
} }
@ -2373,11 +2373,11 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (ps[p].newOwner != nullptr) if (ps[p].newOwner != nullptr)
{ {
ps[p].newOwner = nullptr; ps[p].newOwner = nullptr;
ps[p].pos.X = ps[p].opos.X; ps[p].__int_pos.X = ps[p].opos.X;
ps[p].pos.Y = ps[p].opos.Y; ps[p].__int_pos.Y = ps[p].opos.Y;
ps[p].pos.Z = ps[p].opos.Z; ps[p].__int_pos.Z = ps[p].opos.Z;
updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector); updatesector(ps[p].__int_pos.X, ps[p].__int_pos.Y, &ps[p].cursector);
DukeStatIterator it(STAT_EFFECTOR); DukeStatIterator it(STAT_EFFECTOR);
while (auto act = it.Next()) while (auto act = it.Next())
@ -2526,21 +2526,21 @@ void checksectors_r(int snum)
} }
return; return;
} }
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near , 1280, 3); neartag(p->__int_pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near , 1280, 3);
} }
if (p->newOwner != nullptr) 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->opos.X, p->opos.Y, p->opos.Z }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
else else
{ {
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); neartag(p->__int_pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->pos.X, p->pos.Y, p->pos.Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); 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);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); 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);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{ {
neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3); 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);
if (near.actor() != nullptr) if (near.actor() != nullptr)
{ {
switch (near.actor()->spr.picnum) 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) if (ud.cameraactor == nullptr)
{ {
auto p = &ps[screenpeek]; auto p = &ps[screenpeek];
if (c) *c = p->pos; if (c) *c = p->__int_pos;
if (cs) *cs = p->cursector; if (cs) *cs = p->cursector;
if (ca) *ca = p->angle.ang.asbuild(); 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 a = ps[snum].angle.ang.asbuild() - (krand() & 63) + 8; //Fine tune
act->temp_data[0] = krand() & 1; act->temp_data[0] = krand() & 1;
act->set_int_z((3 << 8) + ps[snum].pyoff + ps[snum].pos.Z - (ps[snum].horizon.sum().asq16() >> 12) + (!isshell ? (3 << 8) : 0)); 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->spr.zvel = -(krand() & 255); act->spr.zvel = -(krand() & 255);
} }
else else
@ -530,7 +530,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
actor->add_int_z(-(18 << 8)); actor->add_int_z(-(18 << 8));
} }
else actor->add_int_z(-(13 << 8)); else actor->add_int_z(-(13 << 8));
actor->spr.ang = getangle(ps[connecthead].pos.X - actor->int_pos().X, ps[connecthead].pos.Y - actor->int_pos().Y); actor->spr.ang = getangle(ps[connecthead].__int_pos.X - actor->int_pos().X, ps[connecthead].__int_pos.Y - actor->int_pos().Y);
actor->spr.xvel = 48 - (krand() & 31); actor->spr.xvel = 48 - (krand() & 31);
ssp(actor, CLIPMASK0); ssp(actor, CLIPMASK0);
} }

View file

@ -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. // 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. // The sound code wants to read a vector out of this so we need to define one for the main coordinate.
vec3_t pos, opos, vel; vec3_t __int_pos, opos, vel;
// player's horizon and angle structs. // player's horizon and angle structs.
PlayerHorizon horizon; PlayerHorizon horizon;