From da73d2bba483088316f0ceb9e62507a5820bdb60 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 10:38:48 +0200 Subject: [PATCH] - renamed player position variables. --- source/games/sw/src/ai.cpp | 4 +- source/games/sw/src/bunny.cpp | 4 +- source/games/sw/src/draw.cpp | 26 +- source/games/sw/src/game.cpp | 2 +- source/games/sw/src/game.h | 20 +- source/games/sw/src/hornet.cpp | 2 +- source/games/sw/src/input.cpp | 2 +- source/games/sw/src/jsector.cpp | 8 +- source/games/sw/src/jweapon.cpp | 12 +- source/games/sw/src/mclip.cpp | 26 +- source/games/sw/src/ninja.cpp | 6 +- source/games/sw/src/osdcmds.cpp | 6 +- source/games/sw/src/player.cpp | 478 ++++++++++++++++---------------- source/games/sw/src/quake.cpp | 6 +- source/games/sw/src/save.cpp | 18 +- source/games/sw/src/sector.cpp | 18 +- source/games/sw/src/sounds.cpp | 20 +- source/games/sw/src/sprite.cpp | 14 +- source/games/sw/src/sumo.cpp | 2 +- source/games/sw/src/track.cpp | 22 +- source/games/sw/src/vis.cpp | 2 +- source/games/sw/src/weapon.cpp | 106 +++---- source/games/sw/src/weapon.h | 2 +- source/games/sw/src/zombie.cpp | 2 +- 24 files changed, 412 insertions(+), 396 deletions(-) diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index 0b30c457a..db31bfaf9 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -324,7 +324,7 @@ int DoActorPickClosePlayer(DSWActor* actor) // continue; } - DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, dist, a, b, c); + DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y, dist, a, b, c); if (dist < near_dist) { @@ -350,7 +350,7 @@ int DoActorPickClosePlayer(DSWActor* actor) continue; } - DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, dist, a, b, c); + DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y, dist, a, b, c); DSWActor* plActor = pp->actor; if (dist < near_dist && FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), plActor->int_pos().X, plActor->int_pos().Y, ActorUpperZ(plActor), plActor->sector())) diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index f572010b4..4b46815dd 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -1003,7 +1003,7 @@ int DoBunnyQuickJump(DSWActor* actor) if (pp == Player+myconnectindex) { choose_snd = StdRandomRange(2<<8)>>8; - if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor)) + if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector) && Facing(actor, actor->user.targetActor)) PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp); } } @@ -1018,7 +1018,7 @@ int DoBunnyQuickJump(DSWActor* actor) if (pp == Player+myconnectindex) { choose_snd = StdRandomRange(3<<8)>>8; - if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor)) + if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector) && Facing(actor, actor->user.targetActor)) PlayerSound(straightsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp); } } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index baf31d402..053889e19 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -780,9 +780,9 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int { pp = tActor->user.PlayerP; int sr = 65536 - int(smoothratio); - tsp->add_int_x(-MulScale(pp->pos.X - pp->opos.X, sr, 16)); - tsp->add_int_y(-MulScale(pp->pos.Y - pp->opos.Y, sr, 16)); - tsp->add_int_z(-MulScale(pp->pos.Z - pp->opos.Z, sr, 16)); + tsp->add_int_x(-MulScale(pp->__int_ppos.X - pp->__int_popos.X, sr, 16)); + tsp->add_int_y(-MulScale(pp->__int_ppos.Y - pp->__int_popos.Y, sr, 16)); + tsp->add_int_z(-MulScale(pp->__int_ppos.Z - pp->__int_popos.Z, sr, 16)); tsp->add_int_ang(-MulScale(pp->angle.ang.Buildang() - pp->angle.oang.Buildang(), sr, 16)); } } @@ -1023,9 +1023,9 @@ FString GameInterface::GetCoordString() { PLAYER* pp = Player + myconnectindex; FString out; - out.AppendFormat("POSX:%d ", pp->pos.X); - out.AppendFormat("POSY:%d ", pp->pos.Y); - out.AppendFormat("POSZ:%d ", pp->pos.Z); + out.AppendFormat("POSX:%d ", pp->__int_ppos.X); + out.AppendFormat("POSY:%d ", pp->__int_ppos.Y); + out.AppendFormat("POSZ:%d ", pp->__int_ppos.Z); out.AppendFormat("ANG:%d\n", pp->angle.ang.Buildang()); return out; @@ -1383,9 +1383,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly) else camerapp = pp; - tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr); - ty = interpolatedvalue(camerapp->opos.Y, camerapp->pos.Y, sr); - tz = interpolatedvalue(camerapp->opos.Z, camerapp->pos.Z, sr); + tx = interpolatedvalue(camerapp->__int_popos.X, camerapp->__int_ppos.X, sr); + ty = interpolatedvalue(camerapp->__int_popos.Y, camerapp->__int_ppos.Y, sr); + tz = interpolatedvalue(camerapp->__int_popos.Z, camerapp->__int_ppos.Z, sr); // Interpolate the player's angle while on a sector object, just like VoidSW. // This isn't needed for the turret as it was fixable, but moving sector objects are problematic. @@ -1410,9 +1410,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly) if (pp->sop_control && (!cl_sointerpolation || (CommEnabled && !pp->sop_remote))) { - tx = pp->pos.X; - ty = pp->pos.Y; - tz = pp->pos.Z; + tx = pp->__int_ppos.X; + ty = pp->__int_ppos.Y; + tz = pp->__int_ppos.Z; tang = pp->angle.ang; } tsect = pp->cursector; @@ -1421,7 +1421,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly) pp->si.X = tx; pp->si.Y = ty; - pp->si.Z = tz - pp->pos.Z; + pp->si.Z = tz - pp->__int_ppos.Z; pp->siang = tang.Buildang(); QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang); diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index 57aaa0422..567b274fb 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -403,7 +403,7 @@ void InitLevel(MapRecord *maprec) currentLevel = maprec; int cursect; SpawnSpriteDef sprites; - loadMap(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].pos, &ang, &cursect, sprites); + loadMap(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].__int_ppos, &ang, &cursect, sprites); spawnactors(sprites); Player[0].cursector = §or[cursect]; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 37adeb2c7..421196c72 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -577,7 +577,23 @@ struct REMOTE_CONTROL struct PLAYER { // variable that fit in the sprite or user structure - vec3_t pos, opos, oldpos; + + // hackery to make the transition easier + union + { + vec3_t __int_ppos; + vec3_t pos; + }; + union + { + vec3_t __int_popos; + vec3_t opos; + }; + union + { + vec3_t __int_poldpos; + vec3_t oldpos; + }; DSWActor* actor; // this may not be a TObjPtr! TObjPtr lowActor, highActor; @@ -1979,7 +1995,7 @@ inline bool SectorIsUnderwaterArea(sectortype* sect) inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, int range) { - return (abs(getincangle(getangle(a->int_pos().X - (pp)->pos.X, a->int_pos().Y - (pp)->pos.Y), (pp)->angle.ang.Buildang())) < (range)); + return (abs(getincangle(getangle(a->int_pos().X - (pp)->__int_ppos.X, a->int_pos().Y - (pp)->__int_ppos.Y), (pp)->angle.ang.Buildang())) < (range)); } inline bool FacingRange(DSWActor* a1, DSWActor* a2, int range) diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index 40dd7b02a..51d038cc1 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -541,7 +541,7 @@ int DoCheckSwarm(DSWActor* actor) if (actor->user.targetActor->user.PlayerP) { pp = actor->user.targetActor->user.PlayerP; - DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, pdist, a, b, c); + DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y, pdist, a, b, c); } else return 0; diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index 70a9a1a23..f99ceeec8 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -186,7 +186,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju if ((pp->Flags2 & PF2_INPUT_CAN_TURN_VEHICLE)) { - DoPlayerTurnVehicle(pp, input.avel, pp->pos.Z + Z(10), labs(pp->pos.Z + Z(10) - pp->sop->floor_loz)); + DoPlayerTurnVehicle(pp, input.avel, pp->__int_ppos.Z + Z(10), labs(pp->__int_ppos.Z + Z(10) - pp->sop->floor_loz)); } if ((pp->Flags2 & PF2_INPUT_CAN_TURN_TURRET)) diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 0a7a54a95..7769bb16c 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -429,8 +429,8 @@ JS_ProcessEchoSpot() { dist = 0x7fffffff; - j = abs(actor->int_pos().X - pp->pos.X); - j += abs(actor->int_pos().Y - pp->pos.Y); + j = abs(actor->int_pos().X - pp->__int_ppos.X); + j += abs(actor->int_pos().Y - pp->__int_ppos.Y); if (j < dist) dist = j; @@ -612,7 +612,7 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio) // If player is dead still then update at MoveSkip4 // rate. - if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->opos.Y && pp->pos.Z == pp->opos.Z) + if (pp->__int_ppos.X == pp->__int_popos.X && pp->__int_ppos.Y == pp->__int_popos.Y && pp->__int_ppos.Z == pp->__int_popos.Z) DoCam = true; @@ -626,7 +626,7 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio) if (TEST_BOOL11(camactor) && numplayers > 1) { - drawroomstotile(cp->pos.X, cp->pos.Y, cp->pos.Z, cp->angle.ang, cp->horizon.horiz, cp->cursector, mirror[cnt].campic, smoothratio); + drawroomstotile(cp->__int_ppos.X, cp->__int_ppos.Y, cp->__int_ppos.Z, cp->angle.ang, cp->horizon.horiz, cp->cursector, mirror[cnt].campic, smoothratio); } else { diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index bdd7b5abc..2a1b52bc7 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1242,9 +1242,9 @@ int PlayerInitChemBomb(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); // Spawn a shot // Inserting and setting up variables @@ -1615,9 +1615,9 @@ int PlayerInitCaltrops(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); auto actorNew = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursector, nx, ny, nz, pp->angle.ang.Buildang(), (CHEMBOMB_VELOCITY + RandomRange(CHEMBOMB_VELOCITY)) / 2); diff --git a/source/games/sw/src/mclip.cpp b/source/games/sw/src/mclip.cpp index ec3cc1e7e..bf6efdc7c 100644 --- a/source/games/sw/src/mclip.cpp +++ b/source/games/sw/src/mclip.cpp @@ -58,7 +58,7 @@ Collision MultiClipMove(PLAYER* pp, int z, int floor_dist) // allowing you to move through wall ang = NORM_ANGLE(pp->angle.ang.Buildang() + sop->clipbox_ang[i]); - vec3_t spos = { pp->pos.X, pp->pos.Y, z }; + vec3_t spos = { pp->__int_ppos.X, pp->__int_ppos.Y, z }; xvect = sop->clipbox_vdist[i] * bcos(ang); yvect = sop->clipbox_vdist[i] * bsin(ang); @@ -71,8 +71,8 @@ Collision MultiClipMove(PLAYER* pp, int z, int floor_dist) min_dist = 0; min_ndx = i; // ox is where it should be - opos[i].X = pos[i].X = pp->pos.X + MulScale(sop->clipbox_vdist[i], bcos(ang), 14); - opos[i].Y = pos[i].Y = pp->pos.Y + MulScale(sop->clipbox_vdist[i], bsin(ang), 14); + opos[i].X = pos[i].X = pp->__int_ppos.X + MulScale(sop->clipbox_vdist[i], bcos(ang), 14); + opos[i].Y = pos[i].Y = pp->__int_ppos.Y + MulScale(sop->clipbox_vdist[i], bsin(ang), 14); // spos.x is where it hit pos[i].X = spos.X; @@ -111,8 +111,8 @@ Collision MultiClipMove(PLAYER* pp, int z, int floor_dist) } // put posx and y off from offset - pp->pos.X += pos[min_ndx].X - opos[min_ndx].X; - pp->pos.Y += pos[min_ndx].Y - opos[min_ndx].Y; + pp->__int_ppos.X += pos[min_ndx].X - opos[min_ndx].X; + pp->__int_ppos.Y += pos[min_ndx].Y - opos[min_ndx].Y; return min_ret; } @@ -131,7 +131,7 @@ short MultiClipTurn(PLAYER* pp, short new_ang, int z, int floor_dist) { ang = NORM_ANGLE(new_ang + sop->clipbox_ang[i]); - vec3_t pos = { pp->pos.X, pp->pos.Y, z }; + vec3_t pos = { pp->__int_ppos.X, pp->__int_ppos.Y, z }; xvect = sop->clipbox_vdist[i] * bcos(ang); yvect = sop->clipbox_vdist[i] * bsin(ang); @@ -201,8 +201,8 @@ int RectClipMove(PLAYER* pp, int *qx, int *qy) //Given the 4 points: x[4], y[4] if (testquadinsect(&point_num, xy, pp->cursector)) { - pp->pos.X += (pp->vect.X>>14); - pp->pos.Y += (pp->vect.Y>>14); + pp->__int_ppos.X += (pp->vect.X>>14); + pp->__int_ppos.Y += (pp->vect.Y>>14); return true; } @@ -218,8 +218,8 @@ int RectClipMove(PLAYER* pp, int *qx, int *qy) } if (testquadinsect(&point_num, xy, pp->cursector)) { - pp->pos.X -= (pp->vect.Y>>15); - pp->pos.Y += (pp->vect.X>>15); + pp->__int_ppos.X -= (pp->vect.Y>>15); + pp->__int_ppos.Y += (pp->vect.X>>15); } return false; @@ -234,8 +234,8 @@ int RectClipMove(PLAYER* pp, int *qx, int *qy) } if (testquadinsect(&point_num, xy, pp->cursector)) { - pp->pos.X += (pp->vect.Y>>15); - pp->pos.Y -= (pp->vect.X>>15); + pp->__int_ppos.X += (pp->vect.Y>>15); + pp->__int_ppos.Y -= (pp->vect.X>>15); } return false; @@ -277,7 +277,7 @@ short RectClipTurn(PLAYER* pp, short new_ang, int *qx, int *qy, int *ox, int *oy for (i = 0; i < 4; i++) { vec2_t const p = { ox[i], oy[i] }; - rotatepoint(pp->pos.vec2, p, rot_ang, &xy[i]); + rotatepoint(pp->__int_ppos.vec2, p, rot_ang, &xy[i]); // cannot use sop->xmid and ymid because the SO is off the map at this point //rotatepoint(&sop->xmid, p, rot_ang, &xy[i]); } diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index 97d0036ba..fa9f08c67 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -2324,8 +2324,8 @@ void InitPlayerSprite(PLAYER* pp) COVER_SetReverb(0); // Turn off any echoing that may have been going before pp->Reverb = 0; - auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector, pp->pos.X, - pp->pos.Y, pp->pos.Z, pp->angle.ang.Buildang(), 0); + auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector, pp->__int_ppos.X, + pp->__int_ppos.Y, pp->__int_ppos.Z, pp->angle.ang.Buildang(), 0); pp->actor = actor; pp->pnum = pnum; @@ -2393,7 +2393,7 @@ void SpawnPlayerUnderSprite(PLAYER* pp) int pnum = int(pp - Player); pp->PlayerUnderActor = SpawnActor(STAT_PLAYER_UNDER0 + pnum, - NINJA_RUN_R0, nullptr, pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, pp->angle.ang.Buildang(), 0); + NINJA_RUN_R0, nullptr, pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->angle.ang.Buildang(), 0); DSWActor* actor = pp->PlayerUnderActor; diff --git a/source/games/sw/src/osdcmds.cpp b/source/games/sw/src/osdcmds.cpp index 49a0cfb94..9d7fb6872 100644 --- a/source/games/sw/src/osdcmds.cpp +++ b/source/games/sw/src/osdcmds.cpp @@ -50,9 +50,9 @@ BEGIN_SW_NS void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) { - Player->opos.X = Player->pos.X = x; - Player->opos.Y = Player->pos.Y = y; - Player->opos.Z = Player->pos.Z = z; + Player->__int_popos.X = Player->__int_ppos.X = x; + Player->__int_popos.Y = Player->__int_ppos.Y = y; + Player->__int_popos.Z = Player->__int_ppos.Z = z; if (ang != INT_MIN) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index b44079915..aaa6cf9ae 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1186,7 +1186,7 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets continue; if (actor->hasU() && actor->user.PlayerP) - zh = actor->user.PlayerP->pos.Z; + zh = actor->user.PlayerP->__int_ppos.Z; else zh = ActorZOfTop(actor) + (ActorSizeZ(actor) >> 2); @@ -1271,24 +1271,24 @@ void DoPlayerTeleportPause(PLAYER* pp) void DoPlayerTeleportToSprite(PLAYER* pp, vec3_t* pos, int ang) { pp->angle.ang = pp->angle.oang = DAngle::fromBuild(ang); - pp->pos.X = pp->opos.X = pp->oldpos.X = pos->X; - pp->pos.Y = pp->opos.Y = pp->oldpos.Y = pos->Y; + pp->__int_ppos.X = pp->__int_popos.X = pp->__int_poldpos.X = pos->X; + pp->__int_ppos.Y = pp->__int_popos.Y = pp->__int_poldpos.Y = pos->Y; //getzsofslopeptr(actor->sector(), pp->posx, pp->posy, &cz, &fz); //pp->posz = pp->oposz = fz - PLAYER_HEIGHT; - pp->pos.Z = pp->opos.Z = pos->Z - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->__int_popos.Z = pos->Z - PLAYER_HEIGHT; - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); pp->Flags2 |= (PF2_TELEPORTED); } void DoPlayerTeleportToOffset(PLAYER* pp) { - pp->opos.X = pp->oldpos.X = pp->pos.X; - pp->opos.Y = pp->oldpos.Y = pp->pos.Y; + pp->__int_popos.X = pp->__int_poldpos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_poldpos.Y = pp->__int_ppos.Y; - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); pp->Flags2 |= (PF2_TELEPORTED); } @@ -1350,7 +1350,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp) TAG 5 to 8 = random match locations #endif - if ((act_warp = Warp(&pp->pos.X, &pp->pos.Y, &pp->pos.Z, &pp->cursector)) == nullptr) + if ((act_warp = Warp(&pp->__int_ppos.X, &pp->__int_ppos.Y, &pp->__int_ppos.Z, &pp->cursector)) == nullptr) { return; } @@ -1417,7 +1417,7 @@ void DoPlayerSetWadeDepth(PLAYER* pp) if ((sectp->extra & SECTFX_SINK)) { // make sure your even in the water - if (pp->pos.Z + PLAYER_HEIGHT > pp->lo_sectp->int_floorz() - Z(FixedToInt(pp->lo_sectp->depth_fixed))) + if (pp->__int_ppos.Z + PLAYER_HEIGHT > pp->lo_sectp->int_floorz() - Z(FixedToInt(pp->lo_sectp->depth_fixed))) pp->WadeDepth = FixedToInt(pp->lo_sectp->depth_fixed); } } @@ -1427,18 +1427,18 @@ void DoPlayerHeight(PLAYER* pp) { int diff; - diff = pp->pos.Z - (pp->loz - PLAYER_HEIGHT); + diff = pp->__int_ppos.Z - (pp->loz - PLAYER_HEIGHT); - pp->pos.Z = pp->pos.Z - ((diff >> 2) + (diff >> 3)); + pp->__int_ppos.Z = pp->__int_ppos.Z - ((diff >> 2) + (diff >> 3)); } void DoPlayerJumpHeight(PLAYER* pp) { if (pp->lo_sectp && (pp->lo_sectp->extra & SECTFX_DYNAMIC_AREA)) { - if (pp->pos.Z + PLAYER_HEIGHT > pp->loz) + if (pp->__int_ppos.Z + PLAYER_HEIGHT > pp->loz) { - pp->pos.Z = pp->loz - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT; DoPlayerBeginRun(pp); } } @@ -1448,8 +1448,8 @@ void DoPlayerCrawlHeight(PLAYER* pp) { int diff; - diff = pp->pos.Z - (pp->loz - PLAYER_CRAWL_HEIGHT); - pp->pos.Z = pp->pos.Z - ((diff >> 2) + (diff >> 3)); + diff = pp->__int_ppos.Z - (pp->loz - PLAYER_CRAWL_HEIGHT); + pp->__int_ppos.Z = pp->__int_ppos.Z - ((diff >> 2) + (diff >> 3)); } void UpdatePlayerSpriteAngle(PLAYER* pp) @@ -1592,7 +1592,7 @@ void SlipSlope(PLAYER* pp) void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust) { bool const canslopetilt = !(pp->Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)) && pp->cursector && (pp->cursector->floorstat & CSTAT_SECTOR_SLOPE); - pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, (pp->Flags & PF_CLIMBING)); + pp->horizon.calcviewpitch(pp->__int_ppos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, (pp->Flags & PF_CLIMBING)); pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust); } @@ -1603,7 +1603,7 @@ void DoPlayerBob(PLAYER* pp) dist = 0; - dist = Distance(pp->pos.X, pp->pos.Y, pp->oldpos.X, pp->oldpos.Y); + dist = Distance(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_poldpos.X, pp->__int_poldpos.Y); if (dist > 512) dist = 0; @@ -1671,7 +1671,7 @@ void DoPlayerSpriteBob(PLAYER* pp, short player_height, short bob_amt, short bob pp->bob_amt = MulScale(bob_amt, bsin(pp->bob_ndx), 14); - pp->actor->set_int_z((pp->pos.Z + player_height) + pp->bob_amt); + pp->actor->set_int_z((pp->__int_ppos.Z + player_height) + pp->bob_amt); } void UpdatePlayerUnderSprite(PLAYER* pp) @@ -1742,7 +1742,7 @@ void UpdatePlayerSprite(PLAYER* pp) // Update sprite representation of player - actor->set_int_xy(pp->pos.X, pp->pos.Y); + actor->set_int_xy(pp->__int_ppos.X, pp->__int_ppos.Y); // there are multiple death functions if (pp->Flags & (PF_DEAD)) @@ -1760,7 +1760,7 @@ void UpdatePlayerSprite(PLAYER* pp) } else if (pp->DoPlayerAction == DoPlayerCrawl) { - actor->set_int_z(pp->pos.Z + PLAYER_CRAWL_HEIGHT); + actor->set_int_z(pp->__int_ppos.Z + PLAYER_CRAWL_HEIGHT); ChangeActorSect(pp->actor, pp->cursector); } #if 0 @@ -1772,7 +1772,7 @@ void UpdatePlayerSprite(PLAYER* pp) #endif else if (pp->DoPlayerAction == DoPlayerWade) { - actor->set_int_z(pp->pos.Z + PLAYER_HEIGHT); + actor->set_int_z(pp->__int_ppos.Z + PLAYER_HEIGHT); ChangeActorSect(pp->actor, pp->cursector); if (pp->WadeDepth > Z(29)) @@ -1783,12 +1783,12 @@ void UpdatePlayerSprite(PLAYER* pp) else if (pp->DoPlayerAction == DoPlayerDive) { // bobbing and sprite position taken care of in DoPlayerDive - actor->set_int_z(pp->pos.Z + Z(10)); + actor->set_int_z(pp->__int_ppos.Z + Z(10)); ChangeActorSect(pp->actor, pp->cursector); } else if (pp->DoPlayerAction == DoPlayerClimb) { - actor->set_int_z(pp->pos.Z + Z(17)); + actor->set_int_z(pp->__int_ppos.Z + Z(17)); ChangeActorSect(pp->actor, pp->cursector); } @@ -1803,12 +1803,12 @@ void UpdatePlayerSprite(PLAYER* pp) } else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump) { - actor->set_int_z(pp->pos.Z + PLAYER_HEIGHT); + actor->set_int_z(pp->__int_ppos.Z + PLAYER_HEIGHT); ChangeActorSect(pp->actor, pp->cursector); } else if (pp->DoPlayerAction == DoPlayerTeleportPause) { - actor->set_int_z(pp->pos.Z + PLAYER_HEIGHT); + actor->set_int_z(pp->__int_ppos.Z + PLAYER_HEIGHT); ChangeActorSect(pp->actor, pp->cursector); } else @@ -1834,7 +1834,7 @@ void DoPlayerZrange(PLAYER* pp) // for an entire box, NOT just a point. -Useful for clipping auto bakcstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); - vec3_t pos = pp->pos; + vec3_t pos = pp->__int_ppos; pos.Z += Z(8); FAFgetzrange(pos, pp->cursector, &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)actor->spr.clipdist<<2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); actor->spr.cstat = bakcstat; @@ -1895,7 +1895,7 @@ void DoPlayerSlide(PLAYER* pp) if (labs(pp->slide_vect.X) < 12800 && labs(pp->slide_vect.Y) < 12800) pp->slide_vect.X = pp->slide_vect.Y = 0; - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + push_ret = pushmove(&pp->__int_ppos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!(pp->Flags & PF_DEAD)) @@ -1909,10 +1909,10 @@ void DoPlayerSlide(PLAYER* pp) return; } Collision coll; - clipmove(pp->pos, &pp->cursector, pp->slide_vect.X, pp->slide_vect.Y, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); + clipmove(pp->__int_ppos, &pp->cursector, pp->slide_vect.X, pp->slide_vect.Y, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); PlayerCheckValidMove(pp); - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + push_ret = pushmove(&pp->__int_ppos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!(pp->Flags & PF_DEAD)) @@ -1931,9 +1931,9 @@ void PlayerCheckValidMove(PLAYER* pp) { if (!pp->insector()) { - pp->pos.X = pp->oldpos.X; - pp->pos.Y = pp->oldpos.Y; - pp->pos.Z = pp->oldpos.Z; + pp->__int_ppos.X = pp->__int_poldpos.X; + pp->__int_ppos.Y = pp->__int_poldpos.Y; + pp->__int_ppos.Z = pp->__int_poldpos.Z; pp->cursector = pp->lastcursector; } } @@ -1954,13 +1954,13 @@ void PlayerSectorBound(PLAYER* pp, int amt) // called from DoPlayerMove() but can be called // from anywhere it is needed - getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz); + getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz); - if (pp->pos.Z > fz - amt) - pp->pos.Z = fz - amt; + if (pp->__int_ppos.Z > fz - amt) + pp->__int_ppos.Z = fz - amt; - if (pp->pos.Z < cz + amt) - pp->pos.Z = cz + amt; + if (pp->__int_ppos.Z < cz + amt) + pp->__int_ppos.Z = cz + amt; } @@ -1989,9 +1989,9 @@ void DoPlayerMove(PLAYER* pp) DoPlayerTurn(pp, pp->input.avel, 1); } - pp->oldpos.X = pp->pos.X; - pp->oldpos.Y = pp->pos.Y; - pp->oldpos.Z = pp->pos.Z; + pp->__int_poldpos.X = pp->__int_ppos.X; + pp->__int_poldpos.Y = pp->__int_ppos.Y; + pp->__int_poldpos.Z = pp->__int_ppos.Z; pp->lastcursector = pp->cursector; if (PLAYER_MOVING(pp) == 0) @@ -2039,18 +2039,18 @@ void DoPlayerMove(PLAYER* pp) auto sect = pp->cursector; if (interpolate_ride) { - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; } - pp->pos.X += pp->vect.X >> 14; - pp->pos.Y += pp->vect.Y >> 14; - updatesector(pp->pos.X, pp->pos.Y, §); + pp->__int_ppos.X += pp->vect.X >> 14; + pp->__int_ppos.Y += pp->vect.Y >> 14; + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §); if (sect != nullptr) pp->cursector = sect; } else { - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER); + push_ret = pushmove(&pp->__int_ppos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER); if (push_ret < 0) { @@ -2066,20 +2066,20 @@ void DoPlayerMove(PLAYER* pp) if (interpolate_ride) { - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; } auto save_cstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); Collision coll; - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); - clipmove(pp->pos, &pp->cursector, pp->vect.X, pp->vect.Y, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); + clipmove(pp->__int_ppos, &pp->cursector, pp->vect.X, pp->vect.Y, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); actor->spr.cstat = save_cstat; PlayerCheckValidMove(pp); - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER); + push_ret = pushmove(&pp->__int_ppos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER); if (push_ret < 0) { @@ -2096,12 +2096,12 @@ void DoPlayerMove(PLAYER* pp) if (interpolate_ride) { - pp->opos.Z = pp->pos.Z; + pp->__int_popos.Z = pp->__int_ppos.Z; pp->angle.backup(); } // check for warp - probably can remove from CeilingHit - if (WarpPlane(&pp->pos.X, &pp->pos.Y, &pp->pos.Z, &pp->cursector)) + if (WarpPlane(&pp->__int_ppos.X, &pp->__int_ppos.Y, &pp->__int_ppos.Z, &pp->cursector)) { PlayerWarpUpdatePos(pp); } @@ -2125,19 +2125,19 @@ void DoPlayerMove(PLAYER* pp) { if (pp->Flags & (PF_FLYING|PF_JUMPING|PF_FALLING)) { - if (pp->pos.Z > pp->loz) - pp->pos.Z = pp->loz - PLAYER_HEIGHT; + if (pp->__int_ppos.Z > pp->loz) + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT; - if (pp->pos.Z < pp->hiz) - pp->pos.Z = pp->hiz + PLAYER_HEIGHT; + if (pp->__int_ppos.Z < pp->hiz) + pp->__int_ppos.Z = pp->hiz + PLAYER_HEIGHT; } else if (pp->Flags & (PF_SWIMMING|PF_DIVING)) { - if (pp->pos.Z > pp->loz) - pp->pos.Z = pp->loz - PLAYER_SWIM_HEIGHT; + if (pp->__int_ppos.Z > pp->loz) + pp->__int_ppos.Z = pp->loz - PLAYER_SWIM_HEIGHT; - if (pp->pos.Z < pp->hiz) - pp->pos.Z = pp->hiz + PLAYER_SWIM_HEIGHT; + if (pp->__int_ppos.Z < pp->hiz) + pp->__int_ppos.Z = pp->hiz + PLAYER_SWIM_HEIGHT; } } } @@ -2151,21 +2151,21 @@ void DoPlayerSectorUpdatePreMove(PLAYER* pp) if ((pp->cursector->extra & SECTFX_DYNAMIC_AREA)) { - updatesectorz(pp->pos.X, pp->pos.Y, pp->pos.Z, §); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, §); if (sect == nullptr) { sect = pp->cursector; - updatesector(pp->pos.X, pp->pos.Y, §); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §); } ASSERT(sect); } else if (FAF_ConnectArea(sect)) { - updatesectorz(pp->pos.X, pp->pos.Y, pp->pos.Z, §); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, §); if (sect == nullptr) { sect = pp->cursector; - updatesector(pp->pos.X, pp->pos.Y, §); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §); } ASSERT(sect); } @@ -2181,7 +2181,7 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp) // need to do updatesectorz if in connect area if (sect != nullptr && FAF_ConnectArea(sect)) { - updatesectorz(pp->pos.X, pp->pos.Y, pp->pos.Z, &pp->cursector); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, &pp->cursector); // can mess up if below if (!pp->insector()) @@ -2189,15 +2189,15 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp) pp->setcursector(sect); // adjust the posz to be in a sector - getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz); - if (pp->pos.Z > fz) - pp->pos.Z = fz; + getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz); + if (pp->__int_ppos.Z > fz) + pp->__int_ppos.Z = fz; - if (pp->pos.Z < cz) - pp->pos.Z = cz; + if (pp->__int_ppos.Z < cz) + pp->__int_ppos.Z = cz; // try again - updatesectorz(pp->pos.X, pp->pos.Y, pp->pos.Z, &pp->cursector); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, &pp->cursector); } } else @@ -2332,17 +2332,17 @@ void SetupDriveCrush(PLAYER* pp, int *x, int *y) { int radius = pp->sop_control->clipdist; - x[0] = pp->pos.X - radius; - y[0] = pp->pos.Y - radius; + x[0] = pp->__int_ppos.X - radius; + y[0] = pp->__int_ppos.Y - radius; - x[1] = pp->pos.X + radius; - y[1] = pp->pos.Y - radius; + x[1] = pp->__int_ppos.X + radius; + y[1] = pp->__int_ppos.Y - radius; - x[2] = pp->pos.X + radius; - y[2] = pp->pos.Y + radius; + x[2] = pp->__int_ppos.X + radius; + y[2] = pp->__int_ppos.Y + radius; - x[3] = pp->pos.X - radius; - y[3] = pp->pos.Y + radius; + x[3] = pp->__int_ppos.X - radius; + y[3] = pp->__int_ppos.Y + radius; } void DriveCrush(PLAYER* pp, int *x, int *y) @@ -2554,7 +2554,7 @@ void DoPlayerMoveVehicle(PLAYER* pp) pp->vect.X = pp->vect.Y = 0; pp->lastcursector = pp->cursector; - z = pp->pos.Z + Z(10); + z = pp->__int_ppos.Z + Z(10); if (RectClip) { @@ -2652,11 +2652,11 @@ void DoPlayerMoveVehicle(PLAYER* pp) plActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); if (pp->sop->clipdist) { - vec3_t clippos = { pp->pos.X, pp->pos.Y, z }; + vec3_t clippos = { pp->__int_ppos.X, pp->__int_ppos.Y, z }; Collision coll; clipmove(clippos, &pp->cursector, pp->vect.X, pp->vect.Y, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll); - pp->pos.vec2 = clippos.vec2; + pp->__int_ppos.vec2 = clippos.vec2; } else { @@ -2686,7 +2686,7 @@ void DoPlayerMoveVehicle(PLAYER* pp) } } - OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), { pp->pos.X * inttoworld, pp->pos.Y * inttoworld }); + OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), { pp->__int_ppos.X * inttoworld, pp->__int_ppos.Y * inttoworld }); pp->cursector = save_sect; // for speed if (!SyncInput()) @@ -2819,14 +2819,14 @@ void DoPlayerJump(PLAYER* pp) } // adjust height by jump speed - pp->pos.Z += pp->jump_speed; + pp->__int_ppos.Z += pp->jump_speed; // if player gets to close the ceiling while jumping //if (pp->posz < pp->hiz + Z(4)) if (PlayerCeilingHit(pp, pp->hiz + Z(4))) { // put player at the ceiling - pp->pos.Z = pp->hiz + Z(4); + pp->__int_ppos.Z = pp->hiz + Z(4); // reverse your speed to falling pp->jump_speed = -pp->jump_speed; @@ -2842,7 +2842,7 @@ void DoPlayerJump(PLAYER* pp) // if player gets to close the floor while jumping if (PlayerFloorHit(pp, pp->loz - pp->floor_dist)) { - pp->pos.Z = pp->loz - pp->floor_dist; + pp->__int_ppos.Z = pp->loz - pp->floor_dist; pp->jump_speed = 0; PlayerSectorBound(pp, Z(1)); @@ -2888,14 +2888,14 @@ void DoPlayerForceJump(PLAYER* pp) } // adjust height by jump speed - pp->pos.Z += pp->jump_speed; + pp->__int_ppos.Z += pp->jump_speed; // if player gets to close the ceiling while jumping //if (pp->posz < pp->hiz + Z(4)) if (PlayerCeilingHit(pp, pp->hiz + Z(4))) { // put player at the ceiling - pp->pos.Z = pp->hiz + Z(4); + pp->__int_ppos.Z = pp->hiz + Z(4); // reverse your speed to falling pp->jump_speed = -pp->jump_speed; @@ -2936,7 +2936,7 @@ void StackedWaterSplash(PLAYER* pp) { auto sect = pp->cursector; - updatesectorz(pp->pos.X, pp->pos.Y, ActorZOfBottom(pp->actor), §); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, ActorZOfBottom(pp->actor), §); if (SectorIsUnderwaterArea(sect)) { @@ -2972,7 +2972,7 @@ void DoPlayerFall(PLAYER* pp) pp->jump_speed = 4100; // adjust player height by jump speed - pp->pos.Z += pp->jump_speed; + pp->__int_ppos.Z += pp->jump_speed; if (pp->jump_speed > 2000) { @@ -3002,7 +3002,7 @@ void DoPlayerFall(PLAYER* pp) if (PlayerCeilingHit(pp, pp->hiz + pp->ceiling_dist)) { // put player at the ceiling - pp->pos.Z = pp->hiz + pp->ceiling_dist; + pp->__int_ppos.Z = pp->hiz + pp->ceiling_dist; // don't return or anything - allow to fall until // hit floor } @@ -3029,14 +3029,14 @@ void DoPlayerFall(PLAYER* pp) // i any kind of crawl key get rid of recoil if (DoPlayerTestCrawl(pp) || (pp->input.actions & SB_CROUCH)) { - pp->pos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; } else { // this was causing the z to snap immediately // changed it so it stays gradual - pp->pos.Z += recoil_amt; + pp->__int_ppos.Z += recoil_amt; DoPlayerHeight(pp); } @@ -3162,26 +3162,26 @@ void DoPlayerClimb(PLAYER* pp) const int ADJ_AMT = 8; // player - if (pp->pos.X != pp->LadderPosition.X) + if (pp->__int_ppos.X != pp->LadderPosition.X) { - if (pp->pos.X < pp->LadderPosition.X) - pp->pos.X += ADJ_AMT; - else if (pp->pos.X > pp->LadderPosition.X) - pp->pos.X -= ADJ_AMT; + if (pp->__int_ppos.X < pp->LadderPosition.X) + pp->__int_ppos.X += ADJ_AMT; + else if (pp->__int_ppos.X > pp->LadderPosition.X) + pp->__int_ppos.X -= ADJ_AMT; - if (labs(pp->pos.X - pp->LadderPosition.X) <= ADJ_AMT) - pp->pos.X = pp->LadderPosition.X; + if (labs(pp->__int_ppos.X - pp->LadderPosition.X) <= ADJ_AMT) + pp->__int_ppos.X = pp->LadderPosition.X; } - if (pp->pos.Y != pp->LadderPosition.Y) + if (pp->__int_ppos.Y != pp->LadderPosition.Y) { - if (pp->pos.Y < pp->LadderPosition.Y) - pp->pos.Y += ADJ_AMT; - else if (pp->pos.Y > pp->LadderPosition.Y) - pp->pos.Y -= ADJ_AMT; + if (pp->__int_ppos.Y < pp->LadderPosition.Y) + pp->__int_ppos.Y += ADJ_AMT; + else if (pp->__int_ppos.Y > pp->LadderPosition.Y) + pp->__int_ppos.Y -= ADJ_AMT; - if (labs(pp->pos.Y - pp->LadderPosition.Y) <= ADJ_AMT) - pp->pos.Y = pp->LadderPosition.Y; + if (labs(pp->__int_ppos.Y - pp->LadderPosition.Y) <= ADJ_AMT) + pp->__int_ppos.Y = pp->LadderPosition.Y; } // sprite @@ -3226,13 +3226,13 @@ void DoPlayerClimb(PLAYER* pp) pp->climb_ndx &= 1023; - pp->pos.Z -= climb_amt; + pp->__int_ppos.Z -= climb_amt; // if player gets to close the ceiling while climbing if (PlayerCeilingHit(pp, pp->hiz)) { // put player at the hiz - pp->pos.Z = pp->hiz; + pp->__int_ppos.Z = pp->hiz; NewStateGroup(pp->actor, sg_PlayerNinjaClimb); } @@ -3240,14 +3240,14 @@ void DoPlayerClimb(PLAYER* pp) if (PlayerCeilingHit(pp, pp->hiz + Z(4))) { // put player at the ceiling - pp->pos.Z = pp->LadderSector->int_ceilingz() + Z(4); + pp->__int_ppos.Z = pp->LadderSector->int_ceilingz() + Z(4); NewStateGroup(pp->actor, sg_PlayerNinjaClimb); } // if floor is ABOVE you && your head goes above it, do a jump up to // terrace - if (pp->pos.Z < pp->LadderSector->int_floorz() - Z(6)) + if (pp->__int_ppos.Z < pp->LadderSector->int_floorz() - Z(6)) { pp->jump_speed = PLAYER_CLIMB_JUMP_AMT; pp->Flags &= ~(PF_CLIMBING|PF_WEAPON_DOWN); @@ -3265,14 +3265,14 @@ void DoPlayerClimb(PLAYER* pp) pp->climb_ndx &= 1023; // pp->posz += MulScale(climb_amt, bsin(pp->climb_ndx), 14); - pp->pos.Z += climb_amt; + pp->__int_ppos.Z += climb_amt; // if you are touching the floor //if (pp->posz >= pp->loz - Z(4) - PLAYER_HEIGHT) if (PlayerFloorHit(pp, pp->loz - Z(4) - PLAYER_HEIGHT)) { // stand on floor - pp->pos.Z = pp->loz - Z(4) - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->loz - Z(4) - PLAYER_HEIGHT; // if moving backwards start running if (climbvel < 0) @@ -3290,7 +3290,7 @@ void DoPlayerClimb(PLAYER* pp) } // setsprite to players location - plActor->set_int_z(pp->pos.Z + PLAYER_HEIGHT); + plActor->set_int_z(pp->__int_ppos.Z + PLAYER_HEIGHT); ChangeActorSect(pp->actor, pp->cursector); if (!SyncInput()) @@ -3304,11 +3304,11 @@ void DoPlayerClimb(PLAYER* pp) if (FAF_ConnectArea(pp->cursector)) { - updatesectorz(pp->pos.X, pp->pos.Y, pp->pos.Z, &pp->cursector); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, &pp->cursector); LadderUpdate = true; } - if (WarpPlane(&pp->pos.X, &pp->pos.Y, &pp->pos.Z, &pp->cursector)) + if (WarpPlane(&pp->__int_ppos.X, &pp->__int_ppos.Y, &pp->__int_ppos.Z, &pp->cursector)) { PlayerWarpUpdatePos(pp); LadderUpdate = true; @@ -3320,7 +3320,7 @@ void DoPlayerClimb(PLAYER* pp) HitInfo near; // constantly look for new ladder sector because of warping at any time - neartag(pp->pos, pp->cursector, pp->angle.ang.Buildang(), near, 800, NTAG_SEARCH_LO_HI); + neartag(pp->__int_ppos, pp->cursector, pp->angle.ang.Buildang(), near, 800, NTAG_SEARCH_LO_HI); if (near.hitWall) { @@ -3359,7 +3359,7 @@ int DoPlayerWadeSuperJump(PLAYER* pp) for (i = 0; i < SIZ(angs); i++) { - FAFhitscan(pp->pos.X, pp->pos.Y, zh, pp->cursector, // Start position + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, zh, pp->cursector, // Start position bcos(pp->angle.ang.Buildang() + angs[i]), // X vector of 3D ang bsin(pp->angle.ang.Buildang() + angs[i]), // Y vector of 3D ang 0, hit, CLIPMASK_MISSILE); // Z vector of 3D ang @@ -3368,9 +3368,9 @@ int DoPlayerWadeSuperJump(PLAYER* pp) { hit.hitSector = hit.hitWall->nextSector(); - if (hit.hitSector != nullptr && labs(hit.hitSector->int_floorz() - pp->pos.Z) < Z(50)) + if (hit.hitSector != nullptr && labs(hit.hitSector->int_floorz() - pp->__int_ppos.Z) < Z(50)) { - if (Distance(pp->pos.X, pp->pos.Y, hit.int_hitpos().X, hit.int_hitpos().Y) < ((((int)pp->actor->spr.clipdist)<<2) + 256)) + if (Distance(pp->__int_ppos.X, pp->__int_ppos.Y, hit.int_hitpos().X, hit.int_hitpos().Y) < ((((int)pp->actor->spr.clipdist)<<2) + 256)) return true; } } @@ -3412,7 +3412,7 @@ void DoPlayerBeginCrawl(PLAYER* pp) bool PlayerFallTest(PLAYER* pp, int player_height) { // If the floor is far below you, fall hard instead of adjusting height - if (labs(pp->pos.Z - pp->loz) > player_height + PLAYER_FALL_HEIGHT) + if (labs(pp->__int_ppos.Z - pp->loz) > player_height + PLAYER_FALL_HEIGHT) { // if on a STEEP slope sector and you have not moved off of the sector if (pp->lo_sectp && @@ -3443,7 +3443,7 @@ void DoPlayerCrawl(PLAYER* pp) if (FAF_ConnectArea(pp->cursector)) { // adjust the z - pp->pos.Z = pp->cursector->int_ceilingz() + Z(12); + pp->__int_ppos.Z = pp->cursector->int_ceilingz() + Z(12); } DoPlayerBeginDiveNoWarp(pp); @@ -3497,7 +3497,7 @@ void DoPlayerCrawl(PLAYER* pp) if (pp->insector() && (pp->cursector->extra & SECTFX_DYNAMIC_AREA)) { - pp->pos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; } DoPlayerBob(pp); @@ -3536,16 +3536,16 @@ void PlayerWarpUpdatePos(PLAYER* pp) if (Prediction) return; - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; - pp->opos.Z = pp->pos.Z; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.Z = pp->__int_ppos.Z; DoPlayerZrange(pp); UpdatePlayerSprite(pp); } bool PlayerCeilingHit(PLAYER* pp, int zlimit) { - if (pp->pos.Z < zlimit) + if (pp->__int_ppos.Z < zlimit) { return true; } @@ -3555,7 +3555,7 @@ bool PlayerCeilingHit(PLAYER* pp, int zlimit) bool PlayerFloorHit(PLAYER* pp, int zlimit) { - if (pp->pos.Z > zlimit) + if (pp->__int_ppos.Z > zlimit) { return true; } @@ -3589,7 +3589,7 @@ void DoPlayerFly(PLAYER* pp) pp->z_speed = MulScale(pp->z_speed, 58000, 16); - pp->pos.Z += pp->z_speed; + pp->__int_ppos.Z += pp->z_speed; // Make the min distance from the ceiling/floor match bobbing amount // so the player never goes into the ceiling/floor @@ -3597,14 +3597,14 @@ void DoPlayerFly(PLAYER* pp) // Only get so close to the ceiling if (PlayerCeilingHit(pp, pp->hiz + PLAYER_FLY_BOB_AMT + Z(8))) { - pp->pos.Z = pp->hiz + PLAYER_FLY_BOB_AMT + Z(8); + pp->__int_ppos.Z = pp->hiz + PLAYER_FLY_BOB_AMT + Z(8); pp->z_speed = 0; } // Only get so close to the floor if (PlayerFloorHit(pp, pp->loz - PLAYER_HEIGHT - PLAYER_FLY_BOB_AMT)) { - pp->pos.Z = pp->loz - PLAYER_HEIGHT - PLAYER_FLY_BOB_AMT; + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT - PLAYER_FLY_BOB_AMT; pp->z_speed = 0; } @@ -3660,7 +3660,7 @@ bool PlayerOnLadder(PLAYER* pp) if (Prediction) return false; - neartag(pp->pos, pp->cursector, pp->angle.ang.Buildang(), near, 1024 + 768, NTAG_SEARCH_LO_HI); + neartag(pp->__int_ppos, pp->cursector, pp->angle.ang.Buildang(), near, 1024 + 768, NTAG_SEARCH_LO_HI); dir = DOT_PRODUCT_2D(pp->vect.X, pp->vect.Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14)); @@ -3672,18 +3672,18 @@ bool PlayerOnLadder(PLAYER* pp) for (i = 0; i < SIZ(angles); i++) { - neartag(pp->pos, pp->cursector, NORM_ANGLE(pp->angle.ang.Buildang() + angles[i]), near, 600, NTAG_SEARCH_LO_HI); + neartag(pp->__int_ppos, pp->cursector, NORM_ANGLE(pp->angle.ang.Buildang() + angles[i]), near, 600, NTAG_SEARCH_LO_HI); if (near.hitWall == nullptr || near.int_hitpos().X < 100 || near.hitWall->lotag != TAG_WALL_CLIMB) return false; - FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector, bcos(pp->angle.ang.Buildang() + angles[i]), bsin(pp->angle.ang.Buildang() + angles[i]), 0, hit, CLIPMASK_MISSILE); - dist = DIST(pp->pos.X, pp->pos.Y, hit.int_hitpos().X, hit.int_hitpos().Y); + dist = DIST(pp->__int_ppos.X, pp->__int_ppos.Y, hit.int_hitpos().X, hit.int_hitpos().Y); if (hit.actor() != nullptr) { @@ -3770,11 +3770,11 @@ int PlayerCanDive(PLAYER* pp) { if (PlayerInDiveArea(pp)) { - pp->pos.Z += Z(20); + pp->__int_ppos.Z += Z(20); pp->z_speed = Z(20); pp->jump_speed = 0; - if (pp->pos.Z > pp->loz - Z(pp->WadeDepth) - Z(2)) + if (pp->__int_ppos.Z > pp->loz - Z(pp->WadeDepth) - Z(2)) { DoPlayerBeginDive(pp); } @@ -3798,14 +3798,14 @@ int PlayerCanDiveNoWarp(PLAYER* pp) { auto sect = pp->cursector; - updatesectorz(pp->pos.X, pp->pos.Y, ActorZOfBottom(pp->actor), §); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, ActorZOfBottom(pp->actor), §); if (SectorIsUnderwaterArea(sect)) { pp->setcursector(sect); - pp->pos.Z = sect->int_ceilingz(); + pp->__int_ppos.Z = sect->int_ceilingz(); - pp->pos.Z += Z(20); + pp->__int_ppos.Z += Z(20); pp->z_speed = Z(20); pp->jump_speed = 0; @@ -4025,28 +4025,28 @@ void DoPlayerWarpToUnderwater(PLAYER* pp) PRODUCTION_ASSERT(Found == true); // get the offset from the sprite - plActor->user.pos.X = over_act->int_pos().X - pp->pos.X; - plActor->user.pos.Y = over_act->int_pos().Y - pp->pos.Y; + plActor->user.pos.X = over_act->int_pos().X - pp->__int_ppos.X; + plActor->user.pos.Y = over_act->int_pos().Y - pp->__int_ppos.Y; // update to the new x y position - pp->pos.X = under_act->int_pos().X - plActor->user.pos.X; - pp->pos.Y = under_act->int_pos().Y - plActor->user.pos.Y; + pp->__int_ppos.X = under_act->int_pos().X - plActor->user.pos.X; + pp->__int_ppos.Y = under_act->int_pos().Y - plActor->user.pos.Y; auto over = over_act->sector(); auto under = under_act->sector(); - if (GetOverlapSector(pp->pos.X, pp->pos.Y, &over, &under) == 2) + if (GetOverlapSector(pp->__int_ppos.X, pp->__int_ppos.Y, &over, &under) == 2) { pp->setcursector(under); } else pp->setcursector(over); - pp->pos.Z = under_act->sector()->int_ceilingz() + Z(6); + pp->__int_ppos.Z = under_act->sector()->int_ceilingz() + Z(6); - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; - pp->opos.Z = pp->pos.Z; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.Z = pp->__int_ppos.Z; DoPlayerZrange(pp); return; @@ -4095,32 +4095,32 @@ void DoPlayerWarpToSurface(PLAYER* pp) PRODUCTION_ASSERT(Found == true); // get the offset from the under sprite - plActor->user.pos.X = under_act->int_pos().X - pp->pos.X; - plActor->user.pos.Y = under_act->int_pos().Y - pp->pos.Y; + plActor->user.pos.X = under_act->int_pos().X - pp->__int_ppos.X; + plActor->user.pos.Y = under_act->int_pos().Y - pp->__int_ppos.Y; // update to the new x y position - pp->pos.X = over_act->int_pos().X - plActor->user.pos.X; - pp->pos.Y = over_act->int_pos().Y - plActor->user.pos.Y; + pp->__int_ppos.X = over_act->int_pos().X - plActor->user.pos.X; + pp->__int_ppos.Y = over_act->int_pos().Y - plActor->user.pos.Y; auto over = over_act->sector(); auto under = under_act->sector(); - if (GetOverlapSector(pp->pos.X, pp->pos.Y, &over, &under)) + if (GetOverlapSector(pp->__int_ppos.X, pp->__int_ppos.Y, &over, &under)) { pp->setcursector(over); } - pp->pos.Z = over_act->sector()->int_floorz() - Z(2); + pp->__int_ppos.Z = over_act->sector()->int_floorz() - Z(2); // set z range and wade depth so we know how high to set view DoPlayerZrange(pp); DoPlayerSetWadeDepth(pp); - pp->pos.Z -= Z(pp->WadeDepth); + pp->__int_ppos.Z -= Z(pp->WadeDepth); - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; - pp->opos.Z = pp->pos.Z; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.Z = pp->__int_ppos.Z; return; } @@ -4402,22 +4402,22 @@ void DoPlayerDive(PLAYER* pp) if (labs(pp->z_speed) < 16) pp->z_speed = 0; - pp->pos.Z += pp->z_speed; + pp->__int_ppos.Z += pp->z_speed; if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursector)) { - if (pp->pos.Z < pp->cursector->int_ceilingz() + Z(10)) + if (pp->__int_ppos.Z < pp->cursector->int_ceilingz() + Z(10)) { auto sect = pp->cursector; // check for sector above to see if it is an underwater sector also - updatesectorz(pp->pos.X, pp->pos.Y, pp->cursector->int_ceilingz() - Z(8), §); + updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->cursector->int_ceilingz() - Z(8), §); if (!SectorIsUnderwaterArea(sect)) { // if not underwater sector we must surface // force into above sector - pp->pos.Z = pp->cursector->int_ceilingz() - Z(8); + pp->__int_ppos.Z = pp->cursector->int_ceilingz() - Z(8); pp->setcursector(sect); DoPlayerStopDiveNoWarp(pp); DoPlayerBeginRun(pp); @@ -4432,9 +4432,9 @@ void DoPlayerDive(PLAYER* pp) if (sectu && (sectu->number == 0 || (sectu->flags & SECTFU_CANT_SURFACE))) { // for room over room water the hiz will be the top rooms ceiling - if (pp->pos.Z < pp->hiz + pp->ceiling_dist) + if (pp->__int_ppos.Z < pp->hiz + pp->ceiling_dist) { - pp->pos.Z = pp->hiz + pp->ceiling_dist; + pp->__int_ppos.Z = pp->hiz + pp->ceiling_dist; } } else @@ -4443,7 +4443,7 @@ void DoPlayerDive(PLAYER* pp) // !JIM! FRANK - I added !pp->hiActor so that you don't warp to surface when // there is a sprite above you since getzrange returns a hiz < ceiling height // if you are clipping into a sprite and not the ceiling. - if (pp->pos.Z < pp->hiz + Z(4) && !pp->highActor) + if (pp->__int_ppos.Z < pp->hiz + Z(4) && !pp->highActor) { DoPlayerStopDive(pp); return; @@ -4451,9 +4451,9 @@ void DoPlayerDive(PLAYER* pp) } // Only get so close to the floor - if (pp->pos.Z >= pp->loz - PLAYER_DIVE_HEIGHT) + if (pp->__int_ppos.Z >= pp->loz - PLAYER_DIVE_HEIGHT) { - pp->pos.Z = pp->loz - PLAYER_DIVE_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_DIVE_HEIGHT; } // make player bob if sitting still @@ -4478,13 +4478,13 @@ void DoPlayerDive(PLAYER* pp) } // Reverse bobbing when getting close to the floor - if (pp->pos.Z + pp->bob_amt >= pp->loz - PLAYER_DIVE_HEIGHT) + if (pp->__int_ppos.Z + pp->bob_amt >= pp->loz - PLAYER_DIVE_HEIGHT) { pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((1024 + 512) - pp->bob_ndx) * 2); DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHT, PLAYER_DIVE_BOB_AMT, 3); } // Reverse bobbing when getting close to the ceiling - if (pp->pos.Z + pp->bob_amt < pp->hiz + pp->ceiling_dist) + if (pp->__int_ppos.Z + pp->bob_amt < pp->hiz + pp->ceiling_dist) { pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((512) - pp->bob_ndx) * 2); DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHT, PLAYER_DIVE_BOB_AMT, 3); @@ -4541,7 +4541,7 @@ void DoPlayerCurrent(PLAYER* pp) xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4; yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4; - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + push_ret = pushmove(&pp->__int_ppos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!(pp->Flags & PF_DEAD)) @@ -4557,10 +4557,10 @@ void DoPlayerCurrent(PLAYER* pp) return; } Collision coll; - clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); + clipmove(pp->__int_ppos, &pp->cursector, xvect, yvect, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); PlayerCheckValidMove(pp); - pushmove(&pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + pushmove(&pp->__int_ppos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!(pp->Flags & PF_DEAD)) @@ -4736,7 +4736,7 @@ void DoPlayerWade(PLAYER* pp) } // If the floor is far below you, fall hard instead of adjusting height - if (labs(pp->pos.Z - pp->loz) > PLAYER_HEIGHT + PLAYER_FALL_HEIGHT) + if (labs(pp->__int_ppos.Z - pp->loz) > PLAYER_HEIGHT + PLAYER_FALL_HEIGHT) { pp->jump_speed = Z(1); DoPlayerBeginFall(pp); @@ -4753,7 +4753,7 @@ void DoPlayerWade(PLAYER* pp) } // If the floor is far below you, fall hard instead of adjusting height - if (labs(pp->pos.Z - pp->loz) > PLAYER_HEIGHT + PLAYER_FALL_HEIGHT) + if (labs(pp->__int_ppos.Z - pp->loz) > PLAYER_HEIGHT + PLAYER_FALL_HEIGHT) { pp->jump_speed = Z(1); DoPlayerBeginFall(pp); @@ -4901,11 +4901,11 @@ void DoPlayerBeginOperate(PLAYER* pp) sop->controller = pp->actor; pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang); - pp->pos.X = sop->int_pmid().X; - pp->pos.Y = sop->int_pmid().Y; - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); - getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.X = sop->int_pmid().X; + pp->__int_ppos.Y = sop->int_pmid().Y; + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); + getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz); + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; pp->Flags &= ~(PF_CRAWLING|PF_JUMPING|PF_FALLING|PF_LOCK_CRAWL); @@ -4930,7 +4930,7 @@ void DoPlayerBeginOperate(PLAYER* pp) PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); else PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; DoPlayerBeginOperateVehicle(pp); break; case SO_TURRET_MGUN: @@ -4939,7 +4939,7 @@ void DoPlayerBeginOperate(PLAYER* pp) PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); else PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; DoPlayerBeginOperateTurret(pp); break; #if 0 @@ -4986,11 +4986,11 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop) auto save_sect = pp->cursector; pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang); - pp->pos.X = sop->int_pmid().X; - pp->pos.Y = sop->int_pmid().Y; - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); - getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.X = sop->int_pmid().X; + pp->__int_ppos.Y = sop->int_pmid().Y; + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); + getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz); + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; pp->Flags &= ~(PF_CRAWLING|PF_JUMPING|PF_FALLING|PF_LOCK_CRAWL); @@ -5018,7 +5018,7 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop) PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); else PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; DoPlayerBeginOperateVehicle(pp); break; case SO_TURRET_MGUN: @@ -5027,7 +5027,7 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop) PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); else PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); - pp->pos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.Z = fz - PLAYER_HEIGHT; DoPlayerBeginOperateTurret(pp); break; default: @@ -5042,9 +5042,9 @@ void PlayerToRemote(PLAYER* pp) pp->remote.cursectp = pp->cursector; pp->remote.lastcursectp = pp->lastcursector; - pp->remote.pos.X = pp->pos.X; - pp->remote.pos.Y = pp->pos.Y; - pp->remote.pos.Z = pp->pos.Z; + pp->remote.pos.X = pp->__int_ppos.X; + pp->remote.pos.Y = pp->__int_ppos.Y; + pp->remote.pos.Z = pp->__int_ppos.Z; pp->remote.vect.X = pp->vect.X; pp->remote.vect.Y = pp->vect.Y; @@ -5059,9 +5059,9 @@ void RemoteToPlayer(PLAYER* pp) pp->setcursector(pp->remote.cursectp); pp->lastcursector = pp->remote.lastcursectp; - pp->pos.X = pp->remote.pos.X; - pp->pos.Y = pp->remote.pos.Y; - pp->pos.Z = pp->remote.pos.Z; + pp->__int_ppos.X = pp->remote.pos.X; + pp->__int_ppos.Y = pp->remote.pos.Y; + pp->__int_ppos.Z = pp->remote.pos.Z; pp->vect.X = pp->remote.vect.X; pp->vect.Y = pp->remote.vect.Y; @@ -5077,9 +5077,9 @@ void PlayerRemoteReset(PLAYER* pp, sectortype* sect) pp->lastcursector = pp->cursector; auto rsp = pp->remoteActor; - pp->pos.X = rsp->int_pos().X; - pp->pos.Y = rsp->int_pos().Y; - pp->pos.Z = sect->int_floorz() - PLAYER_HEIGHT; + pp->__int_ppos.X = rsp->int_pos().X; + pp->__int_ppos.Y = rsp->int_pos().Y; + pp->__int_ppos.Z = sect->int_floorz() - PLAYER_HEIGHT; pp->vect.X = pp->vect.Y = pp->ovect.X = pp->ovect.Y = pp->slide_vect.X = pp->slide_vect.Y = 0; @@ -5110,7 +5110,7 @@ void DoPlayerStopOperate(PLAYER* pp) if (TEST_BOOL1(rsp)) pp->angle.ang = pp->angle.oang = rsp->spr.angle; else - pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->int_pmid().X - pp->pos.X, pp->sop_remote->int_pmid().Y - pp->pos.Y); + pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->int_pmid().X - pp->__int_ppos.X, pp->sop_remote->int_pmid().Y - pp->__int_ppos.Y); } if (pp->sop_control) @@ -5218,14 +5218,14 @@ void DoPlayerDeathJump(PLAYER* pp) } // adjust height by jump speed - pp->pos.Z += pp->jump_speed; + pp->__int_ppos.Z += pp->jump_speed; // if player gets to close the ceiling while jumping //if (pp->posz < pp->hiz + Z(4)) if (PlayerCeilingHit(pp, pp->hiz + Z(4))) { // put player at the ceiling - pp->pos.Z = pp->hiz + Z(4); + pp->__int_ppos.Z = pp->hiz + Z(4); // reverse your speed to falling pp->jump_speed = -pp->jump_speed; @@ -5250,7 +5250,7 @@ void DoPlayerDeathFall(PLAYER* pp) pp->jump_speed += PLAYER_DEATH_GRAV; // adjust player height by jump speed - pp->pos.Z += pp->jump_speed; + pp->__int_ppos.Z += pp->jump_speed; if (pp->lo_sectp && (pp->lo_sectp->extra & SECTFX_SINK)) { @@ -5270,7 +5270,7 @@ void DoPlayerDeathFall(PLAYER* pp) else PlaySound(DIGI_BODYFALL2, pp, v3df_dontpan); - pp->pos.Z = loz - PLAYER_DEATH_HEIGHT; + pp->__int_ppos.Z = loz - PLAYER_DEATH_HEIGHT; pp->Flags &= ~(PF_FALLING); } } @@ -5705,9 +5705,9 @@ void DoPlayerDeathFollowKiller(PLAYER* pp) DSWActor* killer = pp->KillerActor; if (killer) { - if (FAFcansee(killer->int_pos().X, killer->int_pos().Y, ActorZOfTop(killer), killer->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector)) + if (FAFcansee(killer->int_pos().X, killer->int_pos().Y, ActorZOfTop(killer), killer->sector(), pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector)) { - pp->angle.addadjustment(deltaangle(pp->angle.ang, VecToAngle(killer->int_pos().X - pp->pos.X, killer->int_pos().Y - pp->pos.Y)) * (1. / 16.)); + pp->angle.addadjustment(deltaangle(pp->angle.ang, VecToAngle(killer->int_pos().X - pp->__int_ppos.X, killer->int_pos().Y - pp->__int_ppos.Y)) * (1. / 16.)); } } } @@ -5740,7 +5740,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) plActor->spr.picnum = plActor->user.State->Pic; plActor->spr.xrepeat = plActor->spr.yrepeat = PLAYER_NINJA_XREPEAT; plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); - plActor->set_int_pos({ pp->pos.X, pp->pos.Y, pp->pos.Z + PLAYER_HEIGHT }); + plActor->set_int_pos({ pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z + PLAYER_HEIGHT }); plActor->set_int_ang(pp->angle.ang.Buildang()); DoSpawnTeleporterEffect(plActor); @@ -5901,26 +5901,26 @@ void DoPlayerDeathMoveHead(PLAYER* pp) } } - pp->pos.X = plActor->int_pos().X; - pp->pos.Y = plActor->int_pos().Y; + pp->__int_ppos.X = plActor->int_pos().X; + pp->__int_ppos.Y = plActor->int_pos().Y; pp->setcursector(plActor->sector()); // try to stay in valid area - death sometimes throws you out of the map auto sect = pp->cursector; - updatesector(pp->pos.X, pp->pos.Y, §); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §); if (sect == nullptr) { pp->cursector = pp->lv_sector; ChangeActorSect(pp->actor, pp->lv_sector); - pp->pos.X = pp->lv.X; - pp->pos.Y = pp->lv.Y; - plActor->set_int_xy(pp->pos.X, pp->pos.Y); + pp->__int_ppos.X = pp->lv.X; + pp->__int_ppos.Y = pp->lv.Y; + plActor->set_int_xy(pp->__int_ppos.X, pp->__int_ppos.Y); } else { pp->lv_sector = sect; - pp->lv.X = pp->pos.X; - pp->lv.Y = pp->pos.Y; + pp->lv.X = pp->__int_ppos.X; + pp->lv.Y = pp->__int_ppos.Y; } } @@ -5980,14 +5980,14 @@ void DoPlayerDeathDrown(PLAYER* pp) if ((pp->Flags & PF_FALLING)) { - pp->pos.Z += Z(2); + pp->__int_ppos.Z += Z(2); if (MoveSkip2 == 0) actor->add_int_z(Z(4)); // Stick like glue when you hit the ground - if (pp->pos.Z > pp->loz - PLAYER_DEATH_HEIGHT) + if (pp->__int_ppos.Z > pp->loz - PLAYER_DEATH_HEIGHT) { - pp->pos.Z = pp->loz - PLAYER_DEATH_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_DEATH_HEIGHT; pp->Flags &= ~(PF_FALLING); } } @@ -6075,7 +6075,7 @@ void DoPlayerDeathCrumble(PLAYER* pp) } DoPlayerDeathCheckKeys(pp); - plActor->set_int_z(pp->pos.Z+PLAYER_DEAD_HEAD_FLOORZ_OFFSET); + plActor->set_int_z(pp->__int_ppos.Z+PLAYER_DEAD_HEAD_FLOORZ_OFFSET); DoPlayerHeadDebris(pp); } @@ -6128,7 +6128,7 @@ void DoPlayerDeathExplode(PLAYER* pp) } DoPlayerDeathCheckKeys(pp); - plActor->set_int_z(pp->pos.Z+PLAYER_DEAD_HEAD_FLOORZ_OFFSET); + plActor->set_int_z(pp->__int_ppos.Z+PLAYER_DEAD_HEAD_FLOORZ_OFFSET); DoPlayerHeadDebris(pp); } @@ -6202,7 +6202,7 @@ void DoPlayerRun(PLAYER* pp) //DoPlayerHeight(pp); //DoPlayerHeight(pp); //DoPlayerHeight(pp); - pp->pos.Z = pp->loz - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT; DoPlayerBeginJump(pp); return; } @@ -6297,7 +6297,7 @@ void DoPlayerRun(PLAYER* pp) if ((pp->cursector->extra & SECTFX_DYNAMIC_AREA)) { - pp->pos.Z = pp->loz - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT; } // Adjust height moving up and down sectors @@ -6369,9 +6369,9 @@ void MoveSkipSavePos(void) { pp = Player + pnum; - pp->opos.X = pp->pos.X; - pp->opos.Y = pp->pos.Y; - pp->opos.Z = pp->pos.Z; + pp->__int_popos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.Z = pp->__int_ppos.Z; pp->obob_z = pp->bob_z; pp->angle.backup(); pp->horizon.backup(); @@ -6630,8 +6630,8 @@ void domovethings(void) // auto tracking mode for single player multi-game if (numplayers <= 1 && PlayerTrackingMode && pnum == screenpeek && screenpeek != myconnectindex) { - int deltax = Player[myconnectindex].pos.X - Player[screenpeek].pos.X; - int deltay = Player[myconnectindex].pos.Y - Player[screenpeek].pos.Y; + int deltax = Player[myconnectindex].__int_ppos.X - Player[screenpeek].__int_ppos.X; + int deltay = Player[myconnectindex].__int_ppos.Y - Player[screenpeek].__int_ppos.Y; Player[screenpeek].angle.settarget(VecToAngle(deltax, deltay)); } @@ -6701,9 +6701,9 @@ void InitAllPlayers(void) // Initialize all [MAX_SW_PLAYERS] arrays here! for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++) { - pp->pos.X = pp->opos.X = pfirst->pos.X; - pp->pos.Y = pp->opos.Y = pfirst->pos.Y; - pp->pos.Z = pp->opos.Z = pfirst->pos.Z; + pp->__int_ppos.X = pp->__int_popos.X = pfirst->__int_ppos.X; + pp->__int_ppos.Y = pp->__int_popos.Y = pfirst->__int_ppos.Y; + pp->__int_ppos.Z = pp->__int_popos.Z = pfirst->__int_ppos.Z; pp->angle.ang = pp->angle.oang = pfirst->angle.ang; pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz; pp->cursector = pfirst->cursector; @@ -6712,8 +6712,8 @@ void InitAllPlayers(void) //pp->MaxHealth = 100; - pp->oldpos.X = 0; - pp->oldpos.Y = 0; + pp->__int_poldpos.X = 0; + pp->__int_poldpos.Y = 0; pp->climb_ndx = 10; pp->KillerActor = nullptr; pp->Kills = 0; @@ -6773,7 +6773,7 @@ int SearchSpawnPosition(PLAYER* pp) if (opp != pp) // don't test for yourself { - if (FindDistance3D(spawn_sprite->int_pos() - opp->pos) < 1000) + if (FindDistance3D(spawn_sprite->int_pos() - opp->__int_ppos) < 1000) { blocked = true; break; @@ -6851,15 +6851,15 @@ void PlayerSpawnPosition(PLAYER* pp) ASSERT(spawn_sprite != nullptr); - pp->pos = pp->opos = spawn_sprite->int_pos(); + pp->__int_ppos = pp->__int_popos = spawn_sprite->int_pos(); pp->angle.ang = pp->angle.oang = spawn_sprite->spr.angle; pp->setcursector(spawn_sprite->sector()); - getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz); + getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz); // if too close to the floor - stand up - if (pp->pos.Z > fz - PLAYER_HEIGHT) + if (pp->__int_ppos.Z > fz - PLAYER_HEIGHT) { - pp->pos.Z = pp->opos.Z = fz - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->__int_popos.Z = fz - PLAYER_HEIGHT; } } @@ -6909,7 +6909,7 @@ void InitMultiPlayerInfo(void) continue; } - auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, pp->angle.ang.Buildang(), 0); + auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->angle.ang.Buildang(), 0); start0->clearUser(); start0->spr.picnum = ST1; } diff --git a/source/games/sw/src/quake.cpp b/source/games/sw/src/quake.cpp index 586b87223..066da0307 100644 --- a/source/games/sw/src/quake.cpp +++ b/source/games/sw/src/quake.cpp @@ -172,7 +172,7 @@ void QuakeViewChange(PLAYER* pp, int *z_diff, int *x_diff, int *y_diff, short *a SWStatIterator it(STAT_QUAKE_ON); while ((actor = it.Next())) { - dist = FindDistance3D(pp->pos - actor->int_pos()); + dist = FindDistance3D(pp->__int_ppos - actor->int_pos()); // shake whole level if (QUAKE_TestDontTaper(actor)) @@ -242,7 +242,7 @@ void SpawnQuake(sectortype* sect, int x, int y, int z, bool SetQuake(PLAYER* pp, short tics, short amt) { - SpawnQuake(pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, tics, amt, 30000); + SpawnQuake(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, tics, amt, 30000); return false; } @@ -260,7 +260,7 @@ int SetGunQuake(DSWActor* actor) int SetPlayerQuake(PLAYER* pp) { - SpawnQuake(pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, 40, 8, 40000); + SpawnQuake(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, 40, 8, 40000); return 0; } diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 13c12bdd3..20377732d 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -436,9 +436,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER* { if (arc.BeginObject(keyname)) { - arc("x", w.pos.X) - ("y", w.pos.Y) - ("z", w.pos.Z) + arc("x", w.__int_ppos.X) + ("y", w.__int_ppos.Y) + ("z", w.__int_ppos.Z) ("lv_sectnum", w.lv_sector) ("lv_x", w.lv.X) ("lv_y", w.lv.Y) @@ -489,9 +489,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER* ("recoil_ndx", w.recoil_ndx) ("recoil_horizoff", w.recoil_horizoff) ("recoil_ohorizoff", w.recoil_ohorizoff) - ("oldposx", w.oldpos.X) - ("oldposy", w.oldpos.Y) - ("oldposz", w.oldpos.Z) + ("oldposx", w.__int_poldpos.X) + ("oldposy", w.__int_poldpos.Y) + ("oldposz", w.__int_poldpos.Z) ("revolvex", w.Revolve.X) ("revolvey", w.Revolve.Y) ("RevolveDeltaAng", w.RevolveDeltaAng) @@ -580,9 +580,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER* } if (arc.isReading()) { - w.opos.X = w.pos.X; - w.opos.Y = w.pos.X; - w.opos.Z = w.pos.X; + w.__int_popos.X = w.__int_ppos.X; + w.__int_popos.Y = w.__int_ppos.X; + w.__int_popos.Z = w.__int_ppos.X; w.oz_speed = w.z_speed; w.ovect.X = w.vect.X; w.ovect.Y = w.vect.Y; diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 1fdd57367..88848cc82 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -1385,7 +1385,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating) { pp = GlobPlayerP; - if (!FAFcansee(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (ActorSizeZ(actor) >> 1), actor->sector())) + if (!FAFcansee(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (ActorSizeZ(actor) >> 1), actor->sector())) return false; } @@ -1842,7 +1842,7 @@ void OperateTripTrigger(PLAYER* pp) { if (actor->user.Flags & (SPR_WAIT_FOR_TRIGGER)) { - if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y) < dist) + if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y) < dist) { actor->user.targetActor = pp->actor; actor->user.Flags &= ~(SPR_WAIT_FOR_TRIGGER); @@ -1939,7 +1939,7 @@ bool NearThings(PLAYER* pp) return false; } - neartag(pp->pos, pp->cursector, pp->angle.ang.Buildang(), near, 1024, NTAG_SEARCH_LO_HI); + neartag(pp->__int_ppos, pp->cursector, pp->angle.ang.Buildang(), near, 1024, NTAG_SEARCH_LO_HI); // hit a sprite? Check to see if it has sound info in it! @@ -1973,7 +1973,7 @@ bool NearThings(PLAYER* pp) HitInfo hit{}; short dang = pp->angle.ang.Buildang(); - FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z - Z(30), pp->cursector, // Start position + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z - Z(30), pp->cursector, // Start position bcos(dang), // X vector of 3D ang bsin(dang), // Y vector of 3D ang 0, // Z vector of 3D ang @@ -1982,7 +1982,7 @@ bool NearThings(PLAYER* pp) if (hit.hitSector == nullptr) return false; - if (Distance(hit.int_hitpos().X, hit.int_hitpos().Y, pp->pos.X, pp->pos.Y) > 1500) + if (Distance(hit.int_hitpos().X, hit.int_hitpos().Y, pp->__int_ppos.X, pp->__int_ppos.Y) > 1500) return false; // hit a sprite? @@ -2019,7 +2019,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, int z, int dist, int type, int HitInfo near; - neartag({ pp->pos.X, pp->pos.Y, z }, pp->cursector, pp->angle.ang.Buildang(), near, dist, type); + neartag({ pp->__int_ppos.X, pp->__int_ppos.Y, z }, pp->cursector, pp->angle.ang.Buildang(), near, dist, type); if (near.hitSector != nullptr) { @@ -2133,7 +2133,7 @@ int DoPlayerGrabStar(PLAYER* pp) auto actor = StarQueue[i]; if (actor != nullptr) { - if (FindDistance3D(actor->int_pos().X - pp->pos.X, actor->int_pos().Y - pp->pos.Y, actor->int_pos().Z - pp->pos.Z + Z(12)) < 500) + if (FindDistance3D(actor->int_pos().X - pp->__int_ppos.X, actor->int_pos().Y - pp->__int_ppos.Y, actor->int_pos().Z - pp->__int_ppos.Z + Z(12)) < 500) { break; } @@ -2187,7 +2187,7 @@ void PlayerOperateEnv(PLAYER* pp) NearThings(pp); // Check for player sound specified in a level sprite } - BuildNearTagList(nti, sizeof(nti), pp, pp->pos.Z, 2048L, NTAG_SEARCH_LO_HI, 8); + BuildNearTagList(nti, sizeof(nti), pp, pp->__int_ppos.Z, 2048L, NTAG_SEARCH_LO_HI, 8); found = false; @@ -2670,7 +2670,7 @@ void DoSector(void) } else { - DISTANCE(pp->pos.X, pp->pos.Y, sop->int_pmid().X, sop->int_pmid().Y, dist, a, b, c); + DISTANCE(pp->__int_ppos.X, pp->__int_ppos.Y, sop->int_pmid().X, sop->int_pmid().Y, dist, a, b, c); if (dist < min_dist) min_dist = dist; } diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index 13c210074..752f9aa1b 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -122,9 +122,9 @@ short SoundDist(int x, int y, int z, int basedist) double sqrdist, retval; extern short screenpeek; - tx = fabs(Player[screenpeek].pos.X - x); - ty = fabs(Player[screenpeek].pos.Y - y); - tz = fabs((Player[screenpeek].pos.Z - z) >> 4); + tx = fabs(Player[screenpeek].__int_ppos.X - x); + ty = fabs(Player[screenpeek].__int_ppos.Y - y); + tz = fabs((Player[screenpeek].__int_ppos.Z - z) >> 4); // Use the Pythagreon Theorem to compute the magnitude of a 3D vector sqrdist = fabs(tx * tx + ty * ty + tz * tz); @@ -380,7 +380,7 @@ static void UpdateAmbients() if (sdist < 255 && amb->vocIndex == DIGI_WHIPME) { PLAYER* pp = Player + screenpeek; - if (!FAFcansee(spot->int_pos().X, spot->int_pos().Y, spot->int_pos().Z, spot->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector)) + if (!FAFcansee(spot->int_pos().X, spot->int_pos().Y, spot->int_pos().Z, spot->sector(), pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector)) { sdist = 255; } @@ -519,7 +519,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], if (pos != nullptr) { PLAYER* pp = Player + screenpeek; - FVector3 campos = GetSoundPos(pp->pos); + FVector3 campos = GetSoundPos(pp->__int_ppos); vec3_t vpos = {}; bool pancheck = false; @@ -533,7 +533,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], } else if (type == SOURCE_Actor || type == SOURCE_Player) { - vpos = type == SOURCE_Actor ? ((DSWActor*)source)->spr.int_pos() : ((PLAYER*)source)->pos; + vpos = type == SOURCE_Actor ? ((DSWActor*)source)->spr.int_pos() : ((PLAYER*)source)->__int_ppos; pancheck = true; FVector3 npos = GetSoundPos(vpos); @@ -562,7 +562,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], // Can the ambient sound see the player? If not, tone it down some. if ((chanflags & CHANF_LOOP)) { - if (!FAFcansee(vpos.X, vpos.Y, vpos.Z, spot->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector)) + if (!FAFcansee(vpos.X, vpos.Y, vpos.Z, spot->sector(), pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector)) { auto distvec = npos - campos; npos = campos + distvec * 1.75f; // Play more quietly @@ -605,13 +605,13 @@ void GameInterface::UpdateSounds(void) if (TEST_BOOL1(rsp)) tang = rsp->spr.angle; else - tang = VecToAngle(pp->sop_remote->int_pmid().X - pp->pos.X, pp->sop_remote->int_pmid().Y - pp->pos.Y); + tang = VecToAngle(pp->sop_remote->int_pmid().X - pp->__int_ppos.X, pp->sop_remote->int_pmid().Y - pp->__int_ppos.Y); } else tang = pp->angle.ang; listener.angle = float(-tang.Radians()); listener.velocity.Zero(); - listener.position = GetSoundPos(pp->pos); + listener.position = GetSoundPos(pp->__int_ppos); listener.underwater = false; // This should probably use a real environment instead of the pitch hacking in S_PlaySound3D. // listenactor->waterlevel == 3; @@ -654,7 +654,7 @@ int _PlaySound(int num, DSWActor* actor, PLAYER* pp, const vec3_t* const ppos, i } else if (pp && !ppos) { - pos = pp->pos; + pos = pp->__int_ppos; pp = nullptr; } } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index c37a4ef40..97f4e5b0f 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1469,10 +1469,10 @@ void PreMapCombineFloors(void) { if (itsect == dasect) { - pp->pos.X += dx; - pp->pos.Y += dy; - pp->opos.X = pp->oldpos.X = pp->pos.X; - pp->opos.Y = pp->oldpos.Y = pp->pos.Y; + pp->__int_ppos.X += dx; + pp->__int_ppos.Y += dy; + pp->__int_popos.X = pp->__int_poldpos.X = pp->__int_ppos.X; + pp->__int_popos.Y = pp->__int_poldpos.Y = pp->__int_ppos.Y; break; } } @@ -5024,7 +5024,7 @@ int DoGet(DSWActor* actor) if (pp->Flags & (PF_DEAD)) continue; - DISTANCE(pp->pos.X, pp->pos.Y, actor->int_pos().X, actor->int_pos().Y, dist, a,b,c); + DISTANCE(pp->__int_ppos.X, pp->__int_ppos.Y, actor->int_pos().X, actor->int_pos().Y, dist, a,b,c); if ((unsigned)dist > (plActor->user.Radius + actor->user.Radius)) { continue; @@ -5038,7 +5038,7 @@ int DoGet(DSWActor* actor) auto cstat_bak = actor->spr.cstat; actor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); can_see = FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), - pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector); + pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector); actor->spr.cstat = cstat_bak; if (!can_see) @@ -6059,7 +6059,7 @@ void SpriteControl(void) pp = &Player[pnum]; // Only update the ones closest - DISTANCE(pp->pos.X, pp->pos.Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin); + DISTANCE(pp->__int_ppos.X, pp->__int_ppos.Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin); AdjustActiveRange(pp, actor, dist); diff --git a/source/games/sw/src/sumo.cpp b/source/games/sw/src/sumo.cpp index 61074ab84..a31d62b3a 100644 --- a/source/games/sw/src/sumo.cpp +++ b/source/games/sw/src/sumo.cpp @@ -765,7 +765,7 @@ void BossHealthMeter(void) DSWActor* actor = BossSpriteNum[i]; if (actor != nullptr && !bosswasseen[i]) { - if (cansee(actor->int_pos().X, actor->int_pos().Y, ActorZOfTop(actor), actor->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z - Z(40), pp->cursector)) + if (cansee(actor->int_pos().X, actor->int_pos().Y, ActorZOfTop(actor), actor->sector(), pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z - Z(40), pp->cursector)) { if (i == 0 && !bosswasseen[0]) { diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index a7e18cb46..e70697121 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1513,15 +1513,15 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny) pp->Flags |= (PF_PLAYER_RIDING); pp->RevolveAng = pp->angle.ang; - pp->Revolve.X = pp->pos.X; - pp->Revolve.Y = pp->pos.Y; + pp->Revolve.X = pp->__int_ppos.X; + pp->Revolve.Y = pp->__int_ppos.Y; // set the delta angle to 0 when moving pp->RevolveDeltaAng = nullAngle; } - pp->pos.X += nx; - pp->pos.Y += ny; + pp->__int_ppos.X += nx; + pp->__int_ppos.Y += ny; if ((sop->flags & SOBJ_DONT_ROTATE)) { @@ -1537,8 +1537,8 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny) // moving then you // know where he was last pp->RevolveAng = pp->angle.ang; - pp->Revolve.X = pp->pos.X; - pp->Revolve.Y = pp->pos.Y; + pp->Revolve.X = pp->__int_ppos.X; + pp->Revolve.Y = pp->__int_ppos.Y; // set the delta angle to 0 when moving pp->RevolveDeltaAng = nullAngle; @@ -1558,7 +1558,7 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny) // increment Players delta angle pp->RevolveDeltaAng = (pp->RevolveDeltaAng + GlobSpeedSO).Normalized360(); - rotatepoint(sop->int_pmid().vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->pos.vec2); + rotatepoint(sop->int_pmid().vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->__int_ppos.vec2); // THIS WAS CAUSING PROLEMS!!!! // Sectors are still being manipulated so you can end up in a void (-1) sector @@ -1774,7 +1774,7 @@ PlayerPart: // prevents you from falling into map HOLEs created by moving // Sectors and sprites around. //if (!SO_EMPTY(sop)) - updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); + updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); // in case you are in a whirlpool // move perfectly with the ride in the z direction @@ -1783,7 +1783,7 @@ PlayerPart: // move up some for really fast moving plats //pp->posz -= PLAYER_HEIGHT + Z(12); DoPlayerZrange(pp); - pp->pos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_CRAWL_HEIGHT; pp->actor->set_int_z(pp->loz); } else @@ -1794,7 +1794,7 @@ PlayerPart: if (!(pp->Flags & (PF_JUMPING | PF_FALLING | PF_FLYING))) { - pp->pos.Z = pp->loz - PLAYER_HEIGHT; + pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT; pp->actor->set_int_z(pp->loz); } } @@ -3404,7 +3404,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) { pp = &Player[pnum]; - if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y) < actor->user.Dist) + if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y) < actor->user.Dist) { actor->user.targetActor = pp->actor; actor->user.Flags &= ~(SPR_WAIT_FOR_PLAYER); diff --git a/source/games/sw/src/vis.cpp b/source/games/sw/src/vis.cpp index 324ff11a5..f0cc18f1a 100644 --- a/source/games/sw/src/vis.cpp +++ b/source/games/sw/src/vis.cpp @@ -110,7 +110,7 @@ void VisViewChange(PLAYER* pp, int *vis) } // save off the brightest vis that you can see - if (FAFcansee(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, x, y, z, sectp)) + if (FAFcansee(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector, x, y, z, sectp)) { if (VIS_VisCur(actor) < BrightestVis) BrightestVis = VIS_VisCur(actor); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 9fa09aee3..9bd42aed7 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -7254,7 +7254,7 @@ int DoExpDamageTest(DSWActor* actor) // Second parameter MUST have blocking bits set or cansee won't work // added second check for FAF water - hitscans were hitting ceiling if (!FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ActorUpperZ(actor), itActor->sector()) && - !FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ActorLowerZ(actor), itActor->sector())) + !FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, int_ActorLowerZ(actor), itActor->sector())) continue; DoDamage(itActor, actor); @@ -11150,7 +11150,7 @@ int DoRing(DSWActor* actor) int z; // move the center with the player if (pp) - z = pp->pos.Z + Z(20); + z = pp->__int_ppos.Z + Z(20); else z = int_ActorZOfMiddle(own) + Z(30); @@ -11236,7 +11236,7 @@ void InitSpellRing(PLAYER* pp) for (missiles = 0, ang = ang_start; missiles < max_missiles; ang += ang_diff, missiles++) { - auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, FIREBALL1, s_Ring, pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, ang, 0); + auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, FIREBALL1, s_Ring, pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, ang, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.xvel = 500; @@ -11255,7 +11255,7 @@ void InitSpellRing(PLAYER* pp) // put it out there actorNew->add_int_pos({ MulScale(actorNew->user.Dist, bcos(actorNew->int_ang()), 14), MulScale(actorNew->user.Dist, bsin(actorNew->int_ang()), 14), - pp->pos.Z + Z(20) + ((actorNew->user.Dist * (-pp->horizon.horiz.asq16() >> 9)) >> 9) }); + pp->__int_ppos.Z + Z(20) + ((actorNew->user.Dist * (-pp->horizon.horiz.asq16() >> 9)) >> 9) }); actorNew->set_int_ang(NORM_ANGLE(actorNew->int_ang() + 512)); @@ -11583,7 +11583,7 @@ void InitSpellNapalm(PLAYER* pp) for (i = 0; i < SIZ(mp); i++) { auto actor = SpawnActor(STAT_MISSILE, FIREBALL1, s_Napalm, pp->cursector, - pp->pos.X, pp->pos.Y, pp->pos.Z + Z(12), pp->angle.ang.Buildang(), NAPALM_VELOCITY*2); + pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z + Z(12), pp->angle.ang.Buildang(), NAPALM_VELOCITY*2); actor->spr.hitag = LUMINOUS; //Always full brightness @@ -11717,7 +11717,7 @@ int InitSpellMirv(PLAYER* pp) return 0; auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Mirv, pp->cursector, - pp->pos.X, pp->pos.Y, pp->pos.Z + Z(12), pp->angle.ang.Buildang(), MIRV_VELOCITY); + pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z + Z(12), pp->angle.ang.Buildang(), MIRV_VELOCITY); PlaySound(DIGI_MIRVWIZ, actorNew, v3df_follow); @@ -11841,7 +11841,7 @@ int InitSwordAttack(PLAYER* pp) if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY)) continue; - dist = Distance(pp->pos.X, pp->pos.Y, itActor->int_pos().X, itActor->int_pos().Y); + dist = Distance(pp->__int_ppos.X, pp->__int_ppos.Y, itActor->int_pos().X, itActor->int_pos().Y); reach = 1000; // !JIM! was 800 face = 200; @@ -11866,7 +11866,7 @@ int InitSwordAttack(PLAYER* pp) daang = pp->angle.ang.Buildang(); daz = -MulScale(pp->horizon.horiz.asq16(), 2000, 16) + (RandomRange(24000) - 12000); - FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, // Start position + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector, // Start position bcos(daang), // X vector of 3D ang bsin(daang), // Y vector of 3D ang daz, // Z vector of 3D ang @@ -11875,7 +11875,7 @@ int InitSwordAttack(PLAYER* pp) if (hit.hitSector == nullptr) return 0; - if (FindDistance3D(pp->pos - hit.int_hitpos()) < 700) + if (FindDistance3D(pp->__int_ppos - hit.int_hitpos()) < 700) { if (hit.actor() != nullptr) @@ -12009,7 +12009,7 @@ int InitFistAttack(PLAYER* pp) if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY)) continue; - dist = Distance(pp->pos.X, pp->pos.Y, itActor->int_pos().X, itActor->int_pos().Y); + dist = Distance(pp->__int_ppos.X, pp->__int_ppos.Y, itActor->int_pos().X, itActor->int_pos().Y); if (pp->InventoryActive[2]) // Shadow Bombs give you demon fist { @@ -12047,7 +12047,7 @@ int InitFistAttack(PLAYER* pp) daang = pp->angle.ang.Buildang(); daz = -MulScale(pp->horizon.horiz.asq16(), 2000, 16) + (RandomRange(24000) - 12000); - FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, // Start position + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->cursector, // Start position bcos(daang), // X vector of 3D ang bsin(daang), // Y vector of 3D ang daz, // Z vector of 3D ang @@ -12056,7 +12056,7 @@ int InitFistAttack(PLAYER* pp) if (hit.hitSector == nullptr) return 0; - if (FindDistance3D(pp->pos - hit.int_hitpos()) < 700) + if (FindDistance3D(pp->__int_ppos - hit.int_hitpos()) < 700) { if (hit.actor() != nullptr) @@ -12597,10 +12597,10 @@ int InitStar(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); // Spawn a shot // Inserting and setting up variables @@ -12703,7 +12703,7 @@ void InitHeartAttack(PLAYER* pp) return; auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, BLOOD_WORM, s_BloodWorm, pp->cursector, - pp->pos.X, pp->pos.Y, pp->pos.Z + Z(12), pp->angle.ang.Buildang(), BLOOD_WORM_VELOCITY*2); + pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z + Z(12), pp->angle.ang.Buildang(), BLOOD_WORM_VELOCITY*2); actorNew->spr.hitag = LUMINOUS; //Always full brightness @@ -12843,9 +12843,9 @@ int InitShotgun(PLAYER* pp) } } - nx = pp->pos.X; - ny = pp->pos.Y; - daz = nz = pp->pos.Z + pp->bob_z; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + daz = nz = pp->__int_ppos.Z + pp->bob_z; daang = 64; if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) != nullptr) @@ -12997,10 +12997,10 @@ int InitLaser(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); // Spawn a shot // Inserting and setting up variables @@ -13100,10 +13100,10 @@ int InitRail(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; - nz = pp->pos.Z + pp->bob_z + Z(11); + nz = pp->__int_ppos.Z + pp->bob_z + Z(11); // Spawn a shot // Inserting and setting up variables @@ -13269,13 +13269,13 @@ int InitRocket(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; // Spawn a shot // Inserting and setting up variables - nz = pp->pos.Z + pp->bob_z + Z(8); + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, nx, ny, nz, pp->angle.ang.Buildang(), ROCKET_VELOCITY); @@ -13376,14 +13376,14 @@ int InitBunnyRocket(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; // Spawn a shot // Inserting and setting up variables //nz = pp->posz + pp->bob_z + Z(12); - nz = pp->pos.Z + pp->bob_z + Z(8); + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector, nx, ny, nz, pp->angle.ang.Buildang(), ROCKET_VELOCITY); @@ -13479,13 +13479,13 @@ int InitNuke(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; // Spawn a shot // Inserting and setting up variables - nz = pp->pos.Z + pp->bob_z + Z(8); + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, nx, ny, nz, pp->angle.ang.Buildang(), 700); @@ -13634,8 +13634,8 @@ int InitMicro(PLAYER* pp) TARGET_SORT* ts = TargetSort; DSWActor* picked = nullptr; - nx = pp->pos.X; - ny = pp->pos.Y; + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; const int MAX_MICRO = 1; @@ -13663,7 +13663,7 @@ int InitMicro(PLAYER* pp) ang = pp->angle.ang.Buildang(); } - nz = pp->pos.Z + pp->bob_z + Z(14); + nz = pp->__int_ppos.Z + pp->bob_z + Z(14); nz += Z(RandomRange(20)) - Z(10); // Spawn a shot @@ -14828,9 +14828,9 @@ int InitTracerUzi(PLAYER* pp) short lat_dist[] = {800,-800}; - nx = pp->pos.X; - ny = pp->pos.Y; - nz = pp->pos.Z + Z(8) + -MulScale(pp->horizon.horiz.asq16(), 72, 16); + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + nz = pp->__int_ppos.Z + Z(8) + -MulScale(pp->horizon.horiz.asq16(), 72, 16); // Spawn a shot // Inserting and setting up variables @@ -15127,8 +15127,8 @@ int InitUzi(PLAYER* pp) if (RANDOM_P2(1024) < 400) InitTracerUzi(pp); - nz = pp->pos.Z + pp->bob_z; - daz = pp->pos.Z + pp->bob_z; + nz = pp->__int_ppos.Z + pp->bob_z; + daz = pp->__int_ppos.Z + pp->bob_z; daang = 32; if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) != nullptr) { @@ -15147,7 +15147,7 @@ int InitUzi(PLAYER* pp) xvect = bcos(daang); yvect = bsin(daang); zvect = daz; - FAFhitscan(pp->pos.X, pp->pos.Y, nz, pp->cursector, // Start position + FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, nz, pp->cursector, // Start position xvect,yvect,zvect, hit, CLIPMASK_MISSILE); @@ -16280,9 +16280,9 @@ int InitGrenade(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); // Spawn a shot // Inserting and setting up variables @@ -16425,9 +16425,9 @@ int InitMine(PLAYER* pp) if (!pp->insector()) return 0; - nx = pp->pos.X; - ny = pp->pos.Y; - nz = pp->pos.Z + pp->bob_z + Z(8); + nx = pp->__int_ppos.X; + ny = pp->__int_ppos.Y; + nz = pp->__int_ppos.Z + pp->bob_z + Z(8); // Spawn a shot // Inserting and setting up variables @@ -16556,10 +16556,10 @@ int InitFireball(PLAYER* pp) if (!pp->insector()) return 0; - nx += pp->pos.X; - ny += pp->pos.Y; + nx += pp->__int_ppos.X; + ny += pp->__int_ppos.Y; - nz = pp->pos.Z + pp->bob_z + Z(15); + nz = pp->__int_ppos.Z + pp->bob_z + Z(15); auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Fireball, pp->cursector, nx, ny, nz, pp->angle.ang.Buildang(), FIREBALL_VELOCITY); @@ -17755,7 +17755,7 @@ int DoFloorBlood(DSWActor* actor) { pp = &Player[pnum]; - DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, dist, a, b, c); + DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.Y, dist, a, b, c); if (dist < near_dist) { diff --git a/source/games/sw/src/weapon.h b/source/games/sw/src/weapon.h index 2f79af662..ac4d9eab9 100644 --- a/source/games/sw/src/weapon.h +++ b/source/games/sw/src/weapon.h @@ -39,7 +39,7 @@ inline int AngToSprite(DSWActor* actor, DSWActor* other) inline int AngToPlayer(PLAYER* player, DSWActor* other) { - return (getangle(player->pos.X - other->int_pos().X, player->pos.Y - other->int_pos().Y)); + return (getangle(player->__int_ppos.X - other->int_pos().X, player->__int_ppos.Y - other->int_pos().Y)); } diff --git a/source/games/sw/src/zombie.cpp b/source/games/sw/src/zombie.cpp index fba9ea273..a2ea0d9fc 100644 --- a/source/games/sw/src/zombie.cpp +++ b/source/games/sw/src/zombie.cpp @@ -776,7 +776,7 @@ void SpawnZombie(PLAYER* pp, DSWActor* weaponActor) if (ownerActor == nullptr) return; - auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector, pp->pos.X, pp->pos.Y, pp->pos.Z, pp->angle.ang.Buildang(), 0); + auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, pp->angle.ang.Buildang(), 0); SetOwner(actorNew, ownerActor); actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal; actorNew->set_int_ang(RANDOM_P2(2048));