From 4b7d2fcfcca7c582bc84014e9f788705bc733b9c Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 14 Nov 2022 18:52:08 +1100 Subject: [PATCH] - Duke: Rename player's opos to something identifiable. --- source/games/duke/src/actors.cpp | 18 +++++++++--------- source/games/duke/src/actors_d.cpp | 4 ++-- source/games/duke/src/actors_r.cpp | 10 +++++----- source/games/duke/src/animatesprites_d.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 2 +- source/games/duke/src/game_misc.cpp | 4 ++-- source/games/duke/src/gameexec.cpp | 12 ++++++------ source/games/duke/src/player.cpp | 10 +++++----- source/games/duke/src/player_d.cpp | 20 ++++++++++---------- source/games/duke/src/player_r.cpp | 12 ++++++------ source/games/duke/src/player_w.cpp | 2 +- source/games/duke/src/render.cpp | 2 +- source/games/duke/src/sectors.cpp | 6 +++--- source/games/duke/src/sectors_d.cpp | 2 +- source/games/duke/src/sectors_r.cpp | 2 +- source/games/duke/src/types.h | 12 ++++++------ 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 1a632aa48..26538307f 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -374,8 +374,8 @@ void movedummyplayers(void) } } - act->spr.pos.X += (ps[p].PlayerNowPosition.X - ps[p].opos.X); - act->spr.pos.Y += (ps[p].PlayerNowPosition.Y - ps[p].opos.Y); + act->spr.pos.X += (ps[p].PlayerNowPosition.X - ps[p].PlayerOldPosition.X); + act->spr.pos.Y += (ps[p].PlayerNowPosition.Y - ps[p].PlayerOldPosition.Y); SetActor(act, act->spr.pos); } } @@ -400,7 +400,7 @@ void moveplayers(void) { if (p->newOwner != nullptr) //Looking thru the camera { - act->spr.pos = p->opos.plusZ(gs.playerheight); + act->spr.pos = p->PlayerOldPosition.plusZ(gs.playerheight); act->backupz(); act->spr.angle = p->angle.oang; SetActor(act, act->spr.pos); @@ -3046,10 +3046,10 @@ void handle_se17(DDukeActor* actor) { int p = act3->PlayerIndex(); - ps[p].opos -= ps[p].PlayerNowPosition; + ps[p].PlayerOldPosition -= ps[p].PlayerNowPosition; ps[p].PlayerNowPosition.XY() += act2->spr.pos.XY() - actor->spr.pos.XY(); ps[p].PlayerNowPosition.Z += act2->sector()->floorz - sc->floorz; - ps[p].opos += ps[p].PlayerNowPosition; + ps[p].PlayerOldPosition += ps[p].PlayerNowPosition; if (q > 0) ps[p].backupz(); @@ -4419,8 +4419,8 @@ void movefta(void) if (badguy(act)) { auto xyrand = []() -> double { return (64 - (krand() & 127)) * maptoworld; }; - double px = ps[p].opos.X - xyrand(); - double py = ps[p].opos.Y - xyrand(); + double px = ps[p].PlayerOldPosition.X - xyrand(); + double py = ps[p].PlayerOldPosition.Y - xyrand(); updatesector(DVector3(px, py, 0), &psect); if (psect == nullptr) { @@ -4437,14 +4437,14 @@ void movefta(void) { double r1 = zrand(32); double r2 = zrand(52); - canseeme = cansee({ sx, sy, act->spr.pos.Z - r2 }, act->sector(), { px, py, ps[p].opos.Z - r1 }, ps[p].cursector); + canseeme = cansee({ sx, sy, act->spr.pos.Z - r2 }, act->sector(), { px, py, ps[p].PlayerOldPosition.Z - r1 }, ps[p].cursector); } } else { int r1 = krand(); int r2 = krand(); - canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].opos.plusZ(-(r1 & 31)), ps[p].cursector); + canseeme = cansee(act->spr.pos.plusZ(-(r2 & 31)), act->sector(), ps[p].PlayerOldPosition.plusZ(-(r1 & 31)), ps[p].cursector); } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index fa24bb8c3..65b0d7686 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3034,7 +3034,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (a & face_player) { if (ps[playernum].newOwner != nullptr) - goalang = (ps[playernum].opos.XY() - actor->spr.pos.XY()).Angle(); + goalang = (ps[playernum].PlayerOldPosition.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[playernum].PlayerNowPosition.XY() - actor->spr.pos.XY()).Angle(); angdif = deltaangle(actor->spr.angle, goalang) * 0.25; if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle; @@ -3047,7 +3047,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (a & face_player_slow) { if (ps[playernum].newOwner != nullptr) - goalang = (ps[playernum].opos.XY() - actor->spr.pos.XY()).Angle(); + goalang = (ps[playernum].PlayerOldPosition.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[playernum].PlayerNowPosition.XY() - actor->spr.pos.XY()).Angle(); angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... actor->spr.angle += angdif; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index dc094c03a..e0f2bc9b2 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1334,8 +1334,8 @@ void movetransports_r(void) } else if (isRRRA() && k == 2) { - ps[p].opos.X = ps[p].PlayerNowPosition.X += Owner->spr.pos.X - act->spr.pos.X; - ps[p].opos.Y = ps[p].PlayerNowPosition.Y += Owner->spr.pos.Y - act->spr.pos.Y; + ps[p].PlayerOldPosition.X = ps[p].PlayerNowPosition.X += Owner->spr.pos.X - act->spr.pos.X; + ps[p].PlayerOldPosition.Y = ps[p].PlayerNowPosition.Y += Owner->spr.pos.Y - act->spr.pos.Y; ps[p].backupxy(); if (Owner->GetOwner() != Owner) @@ -3212,7 +3212,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (a & face_player) { if (ps[pnum].newOwner != nullptr) - goalang = (ps[pnum].opos.XY() - actor->spr.pos.XY()).Angle(); + goalang = (ps[pnum].PlayerOldPosition.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[pnum].PlayerNowPosition.XY() - actor->spr.pos.XY()).Angle(); angdif = deltaangle(actor->spr.angle, goalang) * 0.25; if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle; @@ -3225,7 +3225,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (a & face_player_slow) { if (ps[pnum].newOwner != nullptr) - goalang = (ps[pnum].opos.XY() - actor->spr.pos.XY()).Angle(); + goalang = (ps[pnum].PlayerOldPosition.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[pnum].PlayerNowPosition.XY() - actor->spr.pos.XY()).Angle(); angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... actor->spr.angle += angdif; @@ -3236,7 +3236,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (a & antifaceplayerslow) { if (ps[pnum].newOwner != nullptr) - goalang = ((ps[pnum].opos.XY() - actor->spr.pos.XY()).Angle() + DAngle180); + goalang = ((ps[pnum].PlayerOldPosition.XY() - actor->spr.pos.XY()).Angle() + DAngle180); else goalang = ((ps[pnum].PlayerNowPosition.XY() - actor->spr.pos.XY()).Angle() + DAngle180); angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... actor->spr.angle += angdif; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 939f04eec..3d95b3a19 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -165,7 +165,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi auto pp = &ps[h->PlayerIndex()]; if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner()) { - t->pos = interpolatedvalue(pp->opos, pp->PlayerNowPosition, interpfrac).plusZ(gs.playerheight); + t->pos = interpolatedvalue(pp->PlayerOldPosition, pp->PlayerNowPosition, interpfrac).plusZ(gs.playerheight); } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) { diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index e25eb24b5..4c6a0ff2f 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -144,7 +144,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi auto pp = &ps[h->PlayerIndex()]; if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && pp->newOwner == nullptr && h->GetOwner()) { - t->pos = interpolatedvalue(pp->opos, pp->PlayerNowPosition, interpfrac).plusZ(gs.playerheight); + t->pos = interpolatedvalue(pp->PlayerOldPosition, pp->PlayerNowPosition, interpfrac).plusZ(gs.playerheight); h->spr.scale = DVector2(0.375, 0.265625); } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index a602dafe0..29e538ff8 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -271,13 +271,13 @@ void drawoverlays(double interpfrac) } else { - cposxy = interpolatedvalue(pp->opos, pp->PlayerNowPosition, interpfrac).XY(); + cposxy = interpolatedvalue(pp->PlayerOldPosition, pp->PlayerNowPosition, interpfrac).XY(); cang = !SyncInput() ? pp->angle.ang : interpolatedvalue(pp->angle.oang, pp->angle.ang, interpfrac); } } else { - cposxy = pp->opos.XY(); + cposxy = pp->PlayerOldPosition.XY(); cang = pp->angle.oang; } DrawOverheadMap(cposxy, cang, interpfrac); diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 28d06af09..1c3433fc2 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -378,18 +378,18 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_OPOSX: - if (bSet) ps[iPlayer].opos.X = lValue * maptoworld; - else SetGameVarID(lVar2, int(ps[iPlayer].opos.X * (1/maptoworld)), sActor, sPlayer); + if (bSet) ps[iPlayer].PlayerOldPosition.X = lValue * maptoworld; + else SetGameVarID(lVar2, int(ps[iPlayer].PlayerOldPosition.X * (1/maptoworld)), sActor, sPlayer); break; case PLAYER_OPOSY: - if (bSet) ps[iPlayer].opos.Y = lValue * maptoworld; - else SetGameVarID(lVar2, int(ps[iPlayer].opos.Y * (1 / maptoworld)), sActor, sPlayer); + if (bSet) ps[iPlayer].PlayerOldPosition.Y = lValue * maptoworld; + else SetGameVarID(lVar2, int(ps[iPlayer].PlayerOldPosition.Y * (1 / maptoworld)), sActor, sPlayer); break; case PLAYER_OPOSZ: - if (bSet) ps[iPlayer].opos.Z = lValue * zmaptoworld; - else SetGameVarID(lVar2, int(ps[iPlayer].opos.Z * (1 / zmaptoworld)), sActor, sPlayer); + if (bSet) ps[iPlayer].PlayerOldPosition.Z = lValue * zmaptoworld; + else SetGameVarID(lVar2, int(ps[iPlayer].PlayerOldPosition.Z * (1 / zmaptoworld)), sActor, sPlayer); break; case PLAYER_PYOFF: diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 656b87f0d..c23806b49 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -765,16 +765,16 @@ void player_struct::backuppos(bool noclipping) { if (!noclipping) { - opos.X = PlayerNowPosition.X; - opos.Y = PlayerNowPosition.Y; + PlayerOldPosition.X = PlayerNowPosition.X; + PlayerOldPosition.Y = PlayerNowPosition.Y; } else { - PlayerNowPosition.X = opos.X; - PlayerNowPosition.Y = opos.Y; + PlayerNowPosition.X = PlayerOldPosition.X; + PlayerNowPosition.Y = PlayerOldPosition.Y; } - opos.Z = PlayerNowPosition.Z; + PlayerOldPosition.Z = PlayerNowPosition.Z; bobpos = PlayerNowPosition.XY(); opyoff = pyoff; } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index da72e7b6a..71fd5ac75 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -109,7 +109,7 @@ static void shootfireball(DDukeActor *actor, int p, DVector3 pos, DAngle ang) double scratch; int j = findplayer(actor, &scratch); double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z + 3) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z + 3) * vel) / dist; } else { @@ -153,7 +153,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng { double x; int j = findplayer(actor, &x); - sang = (ps[j].opos.XY() - spos.XY()).Angle(); + sang = (ps[j].PlayerOldPosition.XY() - spos.XY()).Angle(); if (actor->spr.picnum == BOSS5) { @@ -165,7 +165,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); if (dist != 0) - zvel = (((ps[j].opos.Z - spos.Z) * vel) / dist); + zvel = (((ps[j].PlayerOldPosition.Z - spos.Z) * vel) / dist); if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0) sang = actor->spr.angle + mapangle((krand() & 31) - 16); @@ -605,7 +605,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a ang += DAngle22_5 / 8 - randomAngle(22.5 / 4); #if 1 double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z + 3) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z + 3) * vel) / dist; #else // this is for pitch corrected velocity auto dist = (ps[j].GetActor()->spr.pos - actor->spr.pos).Resized(vel); @@ -693,7 +693,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw { double x; int j = findplayer(actor, &x); - ang = (ps[j].opos.XY() - pos.XY()).Angle(); + ang = (ps[j].PlayerOldPosition.XY() - pos.XY()).Angle(); if (actor->spr.picnum == BOSS3) { double zoffs = 32; @@ -712,7 +712,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z) * vel) / dist; if (badguy(actor) && (actor->spr.hitag & face_player_smart)) ang = actor->spr.angle + randomAngle(DAngle22_5 / 4) - DAngle22_5 / 8; @@ -2043,7 +2043,7 @@ int operateTripbomb(int snum) auto delta = hit.hitpos.XY() - p->PlayerNowPosition.XY(); if (delta.LengthSquared() < (18.125 * 18.125)) { - p->PlayerNowPosition.Z = p->opos.Z; + p->PlayerNowPosition.Z = p->PlayerOldPosition.Z; p->vel.Z = 0; return 1; } @@ -2585,7 +2585,7 @@ static void operateweapon(int snum, ESyncBits actions) case TRIPBOMB_WEAPON: // Claymore in NAM if (p->kickback_pic < 4) { - p->PlayerNowPosition.Z = p->opos.Z; + p->PlayerNowPosition.Z = p->PlayerOldPosition.Z; p->vel.Z = 0; if (p->kickback_pic == 3) fi.shoot(pact, HANDHOLDINGLASER); @@ -2860,7 +2860,7 @@ void processinput_d(int snum) checklook(snum,actions); double iif = 2.5; - auto oldpos = p->opos; + auto oldpos = p->PlayerOldPosition; if (p->on_crane != nullptr) goto HORIZONLY; @@ -3101,7 +3101,7 @@ HORIZONLY: { if (!retry++) { - p->PlayerNowPosition = p->opos = oldpos; + p->PlayerNowPosition = p->PlayerOldPosition = oldpos; continue; } quickkill(p); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index a61afb1a9..68e0b7ca0 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -526,7 +526,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a ang += DAngle22_5 / 8. - randomAngle(22.5 / 4); double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z + 3) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z + 3) * vel) / dist; } double oldzvel = zvel; @@ -613,7 +613,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw { double x; int j = findplayer(actor, &x); - ang = (ps[j].opos.XY() - pos.XY()).Angle(); + ang = (ps[j].PlayerOldPosition.XY() - pos.XY()).Angle(); if (actor->spr.picnum == BOSS3) pos.Z -= 32; else if (actor->spr.picnum == BOSS2) @@ -623,7 +623,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw } double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z) * vel) / dist; if (badguy(actor) && (actor->spr.hitag & face_player_smart)) ang = actor->spr.angle + randomAngle(22.5 / 4) - DAngle22_5 / 8; @@ -758,7 +758,7 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at ang += DAngle22_5/8 - randomAngle(22.5 / 4); double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); - zvel = ((ps[j].opos.Z - pos.Z + 3) * vel) / dist; + zvel = ((ps[j].PlayerOldPosition.Z - pos.Z + 3) * vel) / dist; } double oldzvel = zvel; @@ -3525,7 +3525,7 @@ void processinput_r(int snum) checklook(snum, actions); p->apply_seasick(1); - auto oldpos = p->opos; + auto oldpos = p->PlayerOldPosition; if (p->on_crane != nullptr) goto HORIZONLY; @@ -3888,7 +3888,7 @@ HORIZONLY: { if (!retry++) { - p->PlayerNowPosition = p->opos = oldpos; + p->PlayerNowPosition = p->PlayerOldPosition = oldpos; continue; } quickkill(p); diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index d7ccd0c29..8e448e441 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -436,7 +436,7 @@ void operateweapon_ww(int snum, ESyncBits actions) if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL && p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1)) { - p->PlayerNowPosition.Z = p->opos.Z; + p->PlayerNowPosition.Z = p->PlayerOldPosition.Z; p->vel.Z = 0; } if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum)) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 96efac826..63632a9a0 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -290,7 +290,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly) } else { - cpos = interpolatedvalue(p->opos, p->PlayerNowPosition, interpfrac); + cpos = interpolatedvalue(p->PlayerOldPosition, p->PlayerNowPosition, interpfrac); if (SyncInput()) { diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index d537edb1f..d59c29839 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -226,7 +226,7 @@ int findplayer(const DDukeActor* actor, double* d) if (ud.multimode < 2) { - if (d) *d = (ps[myconnectindex].opos - s).plusZ(28).Sum(); + if (d) *d = (ps[myconnectindex].PlayerOldPosition - s).plusZ(28).Sum(); return myconnectindex; } @@ -235,7 +235,7 @@ int findplayer(const DDukeActor* actor, double* d) for (j = connecthead; j >= 0; j = connectpoint2[j]) { - double x = (ps[j].opos - s).plusZ(28).Sum(); + double x = (ps[j].PlayerOldPosition - s).plusZ(28).Sum(); if (x < closest && ps[j].GetActor()->spr.extra > 0) { closest_player = j; @@ -263,7 +263,7 @@ int findotherplayer(int p, double* d) for (j = connecthead; j >= 0; j = connectpoint2[j]) if (p != j && ps[j].GetActor()->spr.extra > 0) { - double x = (ps[j].opos - ps[p].PlayerNowPosition).Sum(); + double x = (ps[j].PlayerOldPosition - ps[p].PlayerNowPosition).Sum(); if (x < closest) { diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index ce5acc163..dbe584029 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1516,7 +1516,7 @@ void checksectors_d(int snum) return; } if (p->newOwner != nullptr) - neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); + neartag(p->PlayerOldPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); else { neartag(p->PlayerNowPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 5f1fd95bf..397b38c87 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2466,7 +2466,7 @@ void checksectors_r(int snum) } if (p->newOwner != nullptr) - neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); + neartag(p->PlayerOldPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); else { neartag(p->PlayerNowPosition, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag); diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index a62c9a7eb..ffb9212d9 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -176,7 +176,7 @@ struct player_orig struct player_struct { DVector3 vel; - DVector3 PlayerNowPosition, opos; + DVector3 PlayerNowPosition, PlayerOldPosition; DVector2 bobpos; DVector2 fric; DVector2 Exit; @@ -333,23 +333,23 @@ struct player_struct void backupxyz() { - opos = PlayerNowPosition; + PlayerOldPosition = PlayerNowPosition; } void restorexyz() { - PlayerNowPosition = opos; + PlayerNowPosition = PlayerOldPosition; } void backupxy() { - opos.X = PlayerNowPosition.X; - opos.Y = PlayerNowPosition.Y; + PlayerOldPosition.X = PlayerNowPosition.X; + PlayerOldPosition.Y = PlayerNowPosition.Y; } void backupz() { - opos.Z = PlayerNowPosition.Z; + PlayerOldPosition.Z = PlayerNowPosition.Z; } void setbobpos()