mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- int_ppos replacements
This commit is contained in:
parent
da73d2bba4
commit
8e966fc575
23 changed files with 197 additions and 207 deletions
|
@ -42,6 +42,7 @@ struct vec3_t
|
|||
vec3_t& operator+=(const vec3_t& other) { X += other.X; Y += other.Y; Z += other.Z; return *this; };
|
||||
vec3_t& operator-=(const vec3_t& other) { X -= other.X; Y -= other.Y; Z += other.Z; return *this; };
|
||||
vec3_t withZOffset(int ofs) { return { X, Y, Z + ofs }; }
|
||||
vec2_t& XY() { return vec2; }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
|
|||
// continue;
|
||||
}
|
||||
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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()))
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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->__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_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));
|
||||
}
|
||||
}
|
||||
|
@ -1410,9 +1410,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
|||
if (pp->sop_control &&
|
||||
(!cl_sointerpolation || (CommEnabled && !pp->sop_remote)))
|
||||
{
|
||||
tx = pp->__int_ppos.X;
|
||||
ty = pp->__int_ppos.Y;
|
||||
tz = pp->__int_ppos.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->__int_ppos.Z;
|
||||
pp->si.Z = tz - pp->int_ppos().Z;
|
||||
pp->siang = tang.Buildang();
|
||||
|
||||
QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang);
|
||||
|
|
|
@ -582,18 +582,22 @@ struct PLAYER
|
|||
union
|
||||
{
|
||||
vec3_t __int_ppos;
|
||||
vec3_t pos;
|
||||
//vec3_t pos;
|
||||
};
|
||||
union
|
||||
{
|
||||
vec3_t __int_popos;
|
||||
vec3_t opos;
|
||||
//vec3_t opos;
|
||||
};
|
||||
union
|
||||
{
|
||||
vec3_t __int_poldpos;
|
||||
vec3_t oldpos;
|
||||
//vec3_t oldpos;
|
||||
};
|
||||
const vec3_t int_ppos() const
|
||||
{
|
||||
return __int_ppos;
|
||||
}
|
||||
|
||||
DSWActor* actor; // this may not be a TObjPtr!
|
||||
TObjPtr<DSWActor*> lowActor, highActor;
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.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;
|
||||
|
|
|
@ -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->__int_ppos.Z + Z(10), labs(pp->__int_ppos.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))
|
||||
|
|
|
@ -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->__int_ppos.X == pp->__int_popos.X && pp->__int_ppos.Y == pp->__int_popos.Y && pp->__int_ppos.Z == pp->__int_popos.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;
|
||||
|
||||
|
||||
|
|
|
@ -1242,9 +1242,9 @@ int PlayerInitChemBomb(PLAYER* pp)
|
|||
if (!pp->insector())
|
||||
return 0;
|
||||
|
||||
nx = pp->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nz = pp->__int_ppos.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);
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.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->__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);
|
||||
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;
|
||||
|
@ -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->__int_ppos.X, pp->__int_ppos.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);
|
||||
|
|
|
@ -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->__int_ppos.X,
|
||||
pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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;
|
||||
|
||||
|
|
|
@ -50,9 +50,10 @@ BEGIN_SW_NS
|
|||
|
||||
void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
||||
{
|
||||
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;
|
||||
Player->__int_ppos.X = x;
|
||||
Player->__int_ppos.Y = y;
|
||||
Player->__int_ppos.Z = z;
|
||||
Player->__int_popos = Player->__int_ppos;
|
||||
|
||||
if (ang != INT_MIN)
|
||||
{
|
||||
|
|
|
@ -1417,7 +1417,7 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
|
|||
if ((sectp->extra & SECTFX_SINK))
|
||||
{
|
||||
// make sure your even in the water
|
||||
if (pp->__int_ppos.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,16 +1427,16 @@ void DoPlayerHeight(PLAYER* pp)
|
|||
{
|
||||
int diff;
|
||||
|
||||
diff = pp->__int_ppos.Z - (pp->loz - PLAYER_HEIGHT);
|
||||
diff = pp->int_ppos().Z - (pp->loz - PLAYER_HEIGHT);
|
||||
|
||||
pp->__int_ppos.Z = pp->__int_ppos.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->__int_ppos.Z + PLAYER_HEIGHT > pp->loz)
|
||||
if (pp->int_ppos().Z + PLAYER_HEIGHT > pp->loz)
|
||||
{
|
||||
pp->__int_ppos.Z = pp->loz - PLAYER_HEIGHT;
|
||||
DoPlayerBeginRun(pp);
|
||||
|
@ -1448,8 +1448,8 @@ void DoPlayerCrawlHeight(PLAYER* pp)
|
|||
{
|
||||
int diff;
|
||||
|
||||
diff = pp->__int_ppos.Z - (pp->loz - PLAYER_CRAWL_HEIGHT);
|
||||
pp->__int_ppos.Z = pp->__int_ppos.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)
|
||||
|
@ -1603,7 +1603,7 @@ void DoPlayerBob(PLAYER* pp)
|
|||
|
||||
dist = 0;
|
||||
|
||||
dist = Distance(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_poldpos.X, pp->__int_poldpos.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->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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->__int_ppos.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->__int_ppos.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->__int_ppos.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->__int_ppos.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->__int_ppos.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->__int_ppos.Z + PLAYER_HEIGHT);
|
||||
actor->set_int_z(pp->int_ppos().Z + PLAYER_HEIGHT);
|
||||
ChangeActorSect(pp->actor, pp->cursector);
|
||||
}
|
||||
else
|
||||
|
@ -1931,9 +1931,7 @@ void PlayerCheckValidMove(PLAYER* pp)
|
|||
{
|
||||
if (!pp->insector())
|
||||
{
|
||||
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->__int_ppos = pp->__int_poldpos;
|
||||
pp->cursector = pp->lastcursector;
|
||||
}
|
||||
}
|
||||
|
@ -1954,7 +1952,7 @@ void PlayerSectorBound(PLAYER* pp, int amt)
|
|||
// called from DoPlayerMove() but can be called
|
||||
// from anywhere it is needed
|
||||
|
||||
getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &fz);
|
||||
getzsofslopeptr(pp->cursector, pp->int_ppos().X, pp->int_ppos().Y, &cz, &fz);
|
||||
|
||||
if (pp->__int_ppos.Z > fz - amt)
|
||||
pp->__int_ppos.Z = fz - amt;
|
||||
|
@ -1989,9 +1987,7 @@ void DoPlayerMove(PLAYER* pp)
|
|||
DoPlayerTurn(pp, pp->input.avel, 1);
|
||||
}
|
||||
|
||||
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->__int_poldpos = pp->__int_ppos;
|
||||
pp->lastcursector = pp->cursector;
|
||||
|
||||
if (PLAYER_MOVING(pp) == 0)
|
||||
|
@ -2044,7 +2040,7 @@ void DoPlayerMove(PLAYER* pp)
|
|||
}
|
||||
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, §);
|
||||
updatesector(pp->int_ppos().X, pp->int_ppos().Y, §);
|
||||
if (sect != nullptr)
|
||||
pp->cursector = sect;
|
||||
}
|
||||
|
@ -2073,7 +2069,7 @@ void DoPlayerMove(PLAYER* pp)
|
|||
auto save_cstat = actor->spr.cstat;
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
Collision coll;
|
||||
updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector);
|
||||
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;
|
||||
|
@ -2151,21 +2147,21 @@ void DoPlayerSectorUpdatePreMove(PLAYER* pp)
|
|||
|
||||
if ((pp->cursector->extra & SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, §);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, §);
|
||||
if (sect == nullptr)
|
||||
{
|
||||
sect = pp->cursector;
|
||||
updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §);
|
||||
updatesector(pp->int_ppos().X, pp->int_ppos().Y, §);
|
||||
}
|
||||
ASSERT(sect);
|
||||
}
|
||||
else if (FAF_ConnectArea(sect))
|
||||
{
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, §);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, §);
|
||||
if (sect == nullptr)
|
||||
{
|
||||
sect = pp->cursector;
|
||||
updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, §);
|
||||
updatesector(pp->int_ppos().X, pp->int_ppos().Y, §);
|
||||
}
|
||||
ASSERT(sect);
|
||||
}
|
||||
|
@ -2181,7 +2177,7 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp)
|
|||
// need to do updatesectorz if in connect area
|
||||
if (sect != nullptr && FAF_ConnectArea(sect))
|
||||
{
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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,7 +2185,7 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp)
|
|||
pp->setcursector(sect);
|
||||
|
||||
// adjust the posz to be in a sector
|
||||
getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.Y, &cz, &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;
|
||||
|
||||
|
@ -2197,7 +2193,7 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp)
|
|||
pp->__int_ppos.Z = cz;
|
||||
|
||||
// try again
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, &pp->cursector);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, &pp->cursector);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2332,17 +2328,17 @@ void SetupDriveCrush(PLAYER* pp, int *x, int *y)
|
|||
{
|
||||
int radius = pp->sop_control->clipdist;
|
||||
|
||||
x[0] = pp->__int_ppos.X - radius;
|
||||
y[0] = pp->__int_ppos.Y - radius;
|
||||
x[0] = pp->int_ppos().X - radius;
|
||||
y[0] = pp->int_ppos().Y - radius;
|
||||
|
||||
x[1] = pp->__int_ppos.X + radius;
|
||||
y[1] = pp->__int_ppos.Y - radius;
|
||||
x[1] = pp->int_ppos().X + radius;
|
||||
y[1] = pp->int_ppos().Y - radius;
|
||||
|
||||
x[2] = pp->__int_ppos.X + radius;
|
||||
y[2] = pp->__int_ppos.Y + radius;
|
||||
x[2] = pp->int_ppos().X + radius;
|
||||
y[2] = pp->int_ppos().Y + radius;
|
||||
|
||||
x[3] = pp->__int_ppos.X - radius;
|
||||
y[3] = pp->__int_ppos.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 +2550,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
pp->vect.X = pp->vect.Y = 0;
|
||||
|
||||
pp->lastcursector = pp->cursector;
|
||||
z = pp->__int_ppos.Z + Z(10);
|
||||
z = pp->int_ppos().Z + Z(10);
|
||||
|
||||
if (RectClip)
|
||||
{
|
||||
|
@ -2652,7 +2648,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
plActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
if (pp->sop->clipdist)
|
||||
{
|
||||
vec3_t clippos = { pp->__int_ppos.X, pp->__int_ppos.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);
|
||||
|
||||
|
@ -2686,7 +2682,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), { pp->__int_ppos.X * inttoworld, pp->__int_ppos.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())
|
||||
|
@ -2936,7 +2932,7 @@ void StackedWaterSplash(PLAYER* pp)
|
|||
{
|
||||
auto sect = pp->cursector;
|
||||
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, ActorZOfBottom(pp->actor), §);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, ActorZOfBottom(pp->actor), §);
|
||||
|
||||
if (SectorIsUnderwaterArea(sect))
|
||||
{
|
||||
|
@ -3169,7 +3165,7 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
else if (pp->__int_ppos.X > pp->LadderPosition.X)
|
||||
pp->__int_ppos.X -= ADJ_AMT;
|
||||
|
||||
if (labs(pp->__int_ppos.X - pp->LadderPosition.X) <= ADJ_AMT)
|
||||
if (labs(pp->int_ppos().X - pp->LadderPosition.X) <= ADJ_AMT)
|
||||
pp->__int_ppos.X = pp->LadderPosition.X;
|
||||
}
|
||||
|
||||
|
@ -3180,7 +3176,7 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
else if (pp->__int_ppos.Y > pp->LadderPosition.Y)
|
||||
pp->__int_ppos.Y -= ADJ_AMT;
|
||||
|
||||
if (labs(pp->__int_ppos.Y - pp->LadderPosition.Y) <= ADJ_AMT)
|
||||
if (labs(pp->int_ppos().Y - pp->LadderPosition.Y) <= ADJ_AMT)
|
||||
pp->__int_ppos.Y = pp->LadderPosition.Y;
|
||||
}
|
||||
|
||||
|
@ -3290,7 +3286,7 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
}
|
||||
|
||||
// setsprite to players location
|
||||
plActor->set_int_z(pp->__int_ppos.Z + PLAYER_HEIGHT);
|
||||
plActor->set_int_z(pp->int_ppos().Z + PLAYER_HEIGHT);
|
||||
ChangeActorSect(pp->actor, pp->cursector);
|
||||
|
||||
if (!SyncInput())
|
||||
|
@ -3304,7 +3300,7 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
|
||||
if (FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, &pp->cursector);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, &pp->cursector);
|
||||
LadderUpdate = true;
|
||||
}
|
||||
|
||||
|
@ -3359,7 +3355,7 @@ int DoPlayerWadeSuperJump(PLAYER* pp)
|
|||
|
||||
for (i = 0; i < SIZ(angs); i++)
|
||||
{
|
||||
FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.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
|
||||
|
@ -3370,7 +3366,7 @@ int DoPlayerWadeSuperJump(PLAYER* pp)
|
|||
|
||||
if (hit.hitSector != nullptr && labs(hit.hitSector->int_floorz() - pp->__int_ppos.Z) < Z(50))
|
||||
{
|
||||
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))
|
||||
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 +3408,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->__int_ppos.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 &&
|
||||
|
@ -3536,9 +3532,7 @@ void PlayerWarpUpdatePos(PLAYER* pp)
|
|||
if (Prediction)
|
||||
return;
|
||||
|
||||
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->__int_popos = pp->__int_ppos;
|
||||
DoPlayerZrange(pp);
|
||||
UpdatePlayerSprite(pp);
|
||||
}
|
||||
|
@ -3677,13 +3671,13 @@ bool PlayerOnLadder(PLAYER* pp)
|
|||
if (near.hitWall == nullptr || near.int_hitpos().X < 100 || near.hitWall->lotag != TAG_WALL_CLIMB)
|
||||
return false;
|
||||
|
||||
FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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)
|
||||
{
|
||||
|
@ -3798,7 +3792,7 @@ int PlayerCanDiveNoWarp(PLAYER* pp)
|
|||
{
|
||||
auto sect = pp->cursector;
|
||||
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.Y, ActorZOfBottom(pp->actor), §);
|
||||
updatesectorz(pp->int_ppos().X, pp->int_ppos().Y, ActorZOfBottom(pp->actor), §);
|
||||
|
||||
if (SectorIsUnderwaterArea(sect))
|
||||
{
|
||||
|
@ -4025,8 +4019,8 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
|
|||
PRODUCTION_ASSERT(Found == true);
|
||||
|
||||
// get the offset from the sprite
|
||||
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;
|
||||
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->__int_ppos.X = under_act->int_pos().X - plActor->user.pos.X;
|
||||
|
@ -4035,7 +4029,7 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
|
|||
auto over = over_act->sector();
|
||||
auto under = under_act->sector();
|
||||
|
||||
if (GetOverlapSector(pp->__int_ppos.X, pp->__int_ppos.Y, &over, &under) == 2)
|
||||
if (GetOverlapSector(pp->int_ppos().X, pp->int_ppos().Y, &over, &under) == 2)
|
||||
{
|
||||
pp->setcursector(under);
|
||||
}
|
||||
|
@ -4044,9 +4038,7 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
|
|||
|
||||
pp->__int_ppos.Z = under_act->sector()->int_ceilingz() + Z(6);
|
||||
|
||||
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->__int_popos = pp->__int_ppos;
|
||||
|
||||
DoPlayerZrange(pp);
|
||||
return;
|
||||
|
@ -4095,8 +4087,8 @@ 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->__int_ppos.X;
|
||||
plActor->user.pos.Y = under_act->int_pos().Y - pp->__int_ppos.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->__int_ppos.X = over_act->int_pos().X - plActor->user.pos.X;
|
||||
|
@ -4105,7 +4097,7 @@ void DoPlayerWarpToSurface(PLAYER* pp)
|
|||
auto over = over_act->sector();
|
||||
auto under = under_act->sector();
|
||||
|
||||
if (GetOverlapSector(pp->__int_ppos.X, pp->__int_ppos.Y, &over, &under))
|
||||
if (GetOverlapSector(pp->int_ppos().X, pp->int_ppos().Y, &over, &under))
|
||||
{
|
||||
pp->setcursector(over);
|
||||
}
|
||||
|
@ -4118,9 +4110,7 @@ void DoPlayerWarpToSurface(PLAYER* pp)
|
|||
|
||||
pp->__int_ppos.Z -= Z(pp->WadeDepth);
|
||||
|
||||
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->__int_popos = pp->__int_ppos;
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -4411,7 +4401,7 @@ void DoPlayerDive(PLAYER* pp)
|
|||
auto sect = pp->cursector;
|
||||
|
||||
// check for sector above to see if it is an underwater sector also
|
||||
updatesectorz(pp->__int_ppos.X, pp->__int_ppos.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))
|
||||
{
|
||||
|
@ -4478,13 +4468,13 @@ void DoPlayerDive(PLAYER* pp)
|
|||
}
|
||||
|
||||
// Reverse bobbing when getting close to the floor
|
||||
if (pp->__int_ppos.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->__int_ppos.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);
|
||||
|
@ -4736,7 +4726,7 @@ void DoPlayerWade(PLAYER* pp)
|
|||
}
|
||||
|
||||
// If the floor is far below you, fall hard instead of adjusting height
|
||||
if (labs(pp->__int_ppos.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 +4743,7 @@ void DoPlayerWade(PLAYER* pp)
|
|||
}
|
||||
|
||||
// If the floor is far below you, fall hard instead of adjusting height
|
||||
if (labs(pp->__int_ppos.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);
|
||||
|
@ -4903,8 +4893,8 @@ void DoPlayerBeginOperate(PLAYER* pp)
|
|||
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
|
||||
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);
|
||||
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);
|
||||
|
@ -4988,8 +4978,8 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop)
|
|||
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
|
||||
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);
|
||||
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);
|
||||
|
@ -5042,9 +5032,9 @@ void PlayerToRemote(PLAYER* pp)
|
|||
pp->remote.cursectp = pp->cursector;
|
||||
pp->remote.lastcursectp = pp->lastcursector;
|
||||
|
||||
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.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;
|
||||
|
@ -5110,7 +5100,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->__int_ppos.X, pp->sop_remote->int_pmid().Y - pp->__int_ppos.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)
|
||||
|
@ -5705,9 +5695,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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, killer->int_pos().Y - pp->__int_ppos.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 +5730,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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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);
|
||||
|
@ -5907,20 +5897,20 @@ void DoPlayerDeathMoveHead(PLAYER* pp)
|
|||
|
||||
// try to stay in valid area - death sometimes throws you out of the map
|
||||
auto sect = pp->cursector;
|
||||
updatesector(pp->__int_ppos.X, pp->__int_ppos.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->__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);
|
||||
plActor->set_int_xy(pp->int_ppos().X, pp->__int_ppos.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
pp->lv_sector = sect;
|
||||
pp->lv.X = pp->__int_ppos.X;
|
||||
pp->lv.Y = pp->__int_ppos.Y;
|
||||
pp->lv.X = pp->int_ppos().X;
|
||||
pp->lv.Y = pp->int_ppos().Y;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6369,9 +6359,7 @@ void MoveSkipSavePos(void)
|
|||
{
|
||||
pp = Player + pnum;
|
||||
|
||||
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->__int_popos = pp->__int_ppos;
|
||||
pp->obob_z = pp->bob_z;
|
||||
pp->angle.backup();
|
||||
pp->horizon.backup();
|
||||
|
@ -6701,9 +6689,7 @@ void InitAllPlayers(void)
|
|||
// Initialize all [MAX_SW_PLAYERS] arrays here!
|
||||
for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++)
|
||||
{
|
||||
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->__int_ppos = pp->__int_popos = pfirst->__int_ppos;
|
||||
pp->angle.ang = pp->angle.oang = pfirst->angle.ang;
|
||||
pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz;
|
||||
pp->cursector = pfirst->cursector;
|
||||
|
@ -6855,7 +6841,7 @@ void PlayerSpawnPosition(PLAYER* pp)
|
|||
pp->angle.ang = pp->angle.oang = spawn_sprite->spr.angle;
|
||||
pp->setcursector(spawn_sprite->sector());
|
||||
|
||||
getzsofslopeptr(pp->cursector, pp->__int_ppos.X, pp->__int_ppos.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->__int_ppos.Z > fz - PLAYER_HEIGHT)
|
||||
{
|
||||
|
@ -6909,7 +6895,7 @@ void InitMultiPlayerInfo(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.Z, 40, 8, 40000);
|
||||
SpawnQuake(pp->cursector, pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, 40, 8, 40000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -580,9 +580,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
|||
}
|
||||
if (arc.isReading())
|
||||
{
|
||||
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.__int_popos = w.__int_ppos;
|
||||
w.oz_speed = w.z_speed;
|
||||
w.ovect.X = w.vect.X;
|
||||
w.ovect.Y = w.vect.Y;
|
||||
|
|
|
@ -1385,7 +1385,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating)
|
|||
{
|
||||
pp = GlobPlayerP;
|
||||
|
||||
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()))
|
||||
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->__int_ppos.X, pp->__int_ppos.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);
|
||||
|
@ -1973,7 +1973,7 @@ bool NearThings(PLAYER* pp)
|
|||
HitInfo hit{};
|
||||
short dang = pp->angle.ang.Buildang();
|
||||
|
||||
FAFhitscan(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, actor->int_pos().Y - pp->__int_ppos.Y, actor->int_pos().Z - pp->__int_ppos.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->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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;
|
||||
}
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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;
|
||||
}
|
||||
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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,7 +605,7 @@ void GameInterface::UpdateSounds(void)
|
|||
if (TEST_BOOL1(rsp))
|
||||
tang = rsp->spr.angle;
|
||||
else
|
||||
tang = VecToAngle(pp->sop_remote->int_pmid().X - pp->__int_ppos.X, pp->sop_remote->int_pmid().Y - pp->__int_ppos.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;
|
||||
|
||||
|
|
|
@ -5024,7 +5024,7 @@ int DoGet(DSWActor* actor)
|
|||
if (pp->Flags & (PF_DEAD))
|
||||
continue;
|
||||
|
||||
DISTANCE(pp->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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);
|
||||
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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])
|
||||
{
|
||||
|
|
|
@ -1513,8 +1513,8 @@ 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->__int_ppos.X;
|
||||
pp->Revolve.Y = pp->__int_ppos.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;
|
||||
|
@ -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->__int_ppos.X;
|
||||
pp->Revolve.Y = pp->__int_ppos.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;
|
||||
|
@ -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->__int_ppos.X, pp->__int_ppos.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
|
||||
|
@ -3404,7 +3404,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
{
|
||||
pp = &Player[pnum];
|
||||
|
||||
if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->__int_ppos.X, pp->__int_ppos.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);
|
||||
|
|
|
@ -110,7 +110,7 @@ void VisViewChange(PLAYER* pp, int *vis)
|
|||
}
|
||||
|
||||
// save off the brightest vis that you can see
|
||||
if (FAFcansee(pp->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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);
|
||||
|
|
|
@ -11150,7 +11150,7 @@ int DoRing(DSWActor* actor)
|
|||
int z;
|
||||
// move the center with the player
|
||||
if (pp)
|
||||
z = pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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
|
||||
|
@ -12009,7 +12009,7 @@ int InitFistAttack(PLAYER* pp)
|
|||
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
|
||||
continue;
|
||||
|
||||
dist = Distance(pp->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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
|
||||
|
@ -12597,10 +12597,10 @@ int InitStar(PLAYER* pp)
|
|||
if (!pp->insector())
|
||||
return 0;
|
||||
|
||||
nx = pp->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nx = pp->int_ppos().X;
|
||||
ny = pp->int_ppos().Y;
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
daz = nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nx = pp->int_ppos().X;
|
||||
ny = pp->int_ppos().Y;
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nx = pp->int_ppos().X;
|
||||
ny = pp->int_ppos().Y;
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nx = pp->int_ppos().X;
|
||||
ny = pp->int_ppos().Y;
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.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->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nx = pp->int_ppos().X;
|
||||
ny = pp->int_ppos().Y;
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.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->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nz = pp->__int_ppos.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->__int_ppos.Z + pp->bob_z;
|
||||
daz = pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny = pp->__int_ppos.Y;
|
||||
nz = pp->__int_ppos.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->__int_ppos.X;
|
||||
ny += pp->__int_ppos.Y;
|
||||
nx += pp->int_ppos().X;
|
||||
ny += pp->int_ppos().Y;
|
||||
|
||||
nz = pp->__int_ppos.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->__int_ppos.X, pp->__int_ppos.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)
|
||||
{
|
||||
|
|
|
@ -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->__int_ppos.X, pp->__int_ppos.Y, pp->__int_ppos.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));
|
||||
|
|
Loading…
Reference in a new issue