- SW: Wrap access to player's actor pointer.

This commit is contained in:
Mitchell Richters 2023-09-30 20:51:34 +10:00
parent 61bc8c23cf
commit a20e2b64f9
25 changed files with 532 additions and 527 deletions

View file

@ -250,7 +250,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
goto TARGETACTOR;
// Set initial target to Player 0
actor->user.targetActor = Player->actor;
actor->user.targetActor = Player->GetActor();
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
@ -258,10 +258,10 @@ int DoActorPickClosePlayer(DSWActor* actor)
{
pp = &Player[pnum];
if (GetOwner(actor) == pp->actor)
if (GetOwner(actor) == pp->GetActor())
continue;
actor->user.targetActor = pp->actor;
actor->user.targetActor = pp->GetActor();
break;
}
}
@ -275,7 +275,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
// Zombies don't target their masters!
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if (GetOwner(actor) == pp->actor)
if (GetOwner(actor) == pp->GetActor())
continue;
if (!PlayerTakeDamage(pp, actor))
@ -286,12 +286,12 @@ int DoActorPickClosePlayer(DSWActor* actor)
// continue;
}
dist = (actor->spr.pos - pp->actor->getPosWithOffsetZ()).Length();
dist = (actor->spr.pos - pp->GetActor()->getPosWithOffsetZ()).Length();
if (dist < near_dist)
{
near_dist = dist;
actor->user.targetActor = pp->actor;
actor->user.targetActor = pp->GetActor();
}
}
@ -305,21 +305,21 @@ int DoActorPickClosePlayer(DSWActor* actor)
// Zombies don't target their masters!
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if (GetOwner(actor) == pp->actor)
if (GetOwner(actor) == pp->GetActor())
continue;
if (!PlayerTakeDamage(pp, actor))
continue;
}
dist = (actor->spr.pos - pp->actor->getPosWithOffsetZ()).Length();
dist = (actor->spr.pos - pp->GetActor()->getPosWithOffsetZ()).Length();
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
if (dist < near_dist && FAFcansee(ActorVectOfTop(actor), actor->sector(), ActorUpperVect(plActor), plActor->sector()))
{
near_dist = dist;
actor->user.targetActor = pp->actor;
actor->user.targetActor = pp->GetActor();
found = true;
}
}
@ -368,9 +368,9 @@ DSWActor* GetPlayerSpriteNum(DSWActor* actor)
{
pp = &Player[pnum];
if (pp->actor == actor->user.targetActor)
if (pp->GetActor() == actor->user.targetActor)
{
return pp->actor;
return pp->GetActor();
}
}
return nullptr;

View file

@ -1015,7 +1015,7 @@ int DoBunnyQuickJump(DSWActor* actor)
if (pp == Player+myconnectindex)
{
choose_snd = StdRandomRange(2<<8)>>8;
if (FAFcansee(ActorVectOfTop(actor),actor->sector(),pp->actor->getPosWithOffsetZ(), pp->cursector) && Facing(actor, actor->user.targetActor))
if (FAFcansee(ActorVectOfTop(actor),actor->sector(),pp->GetActor()->getPosWithOffsetZ(), pp->cursector) && Facing(actor, actor->user.targetActor))
PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
}
}
@ -1030,7 +1030,7 @@ int DoBunnyQuickJump(DSWActor* actor)
if (pp == Player+myconnectindex)
{
choose_snd = StdRandomRange(3<<8)>>8;
if (FAFcansee(ActorVectOfTop(actor), actor->sector(), pp->actor->getPosWithOffsetZ(), pp->cursector) && Facing(actor, actor->user.targetActor))
if (FAFcansee(ActorVectOfTop(actor), actor->sector(), pp->GetActor()->getPosWithOffsetZ(), pp->cursector) && Facing(actor, actor->user.targetActor))
PlayerSound(straightsnds[choose_snd], v3df_doppler | v3df_follow | v3df_dontpan, pp);
}
}

View file

@ -278,7 +278,7 @@ static void WeaponCheat(int player)
p->WpnRocketHeat = 5;
p->WpnRocketNuke = 1;
PlayerUpdateWeapon(p, p->actor->user.WeaponNum);
PlayerUpdateWeapon(p, p->GetActor()->user.WeaponNum);
}
//---------------------------------------------------------------------------
@ -338,9 +338,9 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
break;
case GIVE_HEALTH:
if (Player[player].actor->user.Health < Player[player].MaxHealth)
if (Player[player].GetActor()->user.Health < Player[player].MaxHealth)
{
Player[player].actor->user.Health += 25;
Player[player].GetActor()->user.Health += 25;
PutStringInfo(&Player[player], GStrings("TXTS_ADDEDHEALTH"));
}
break;
@ -362,12 +362,12 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
p->WpnAmmo[i] = DamageData[i].max_ammo;
}
PlayerUpdateWeapon(p, p->actor->user.WeaponNum);
PlayerUpdateWeapon(p, p->GetActor()->user.WeaponNum);
break;
}
case GIVE_ARMOR:
if (Player[player].actor->user.Health < Player[player].MaxHealth)
if (Player[player].GetActor()->user.Health < Player[player].MaxHealth)
{
Player[player].Armor = 100;
PutStringInfo(&Player[player], GStrings("TXTB_FULLARM"));

View file

@ -775,7 +775,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
ShadeSprite(tsp);
// sw if its your playersprite
if (Player[screenpeek].actor == tActor)
if (Player[screenpeek].GetActor() == tActor)
{
pp = Player + screenpeek;
if (display_mirror || (pp->Flags & (PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA)))
@ -792,9 +792,9 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
pos.Z -= PLAYER_HEIGHTF - 17.;
}
if ((pp->Flags & PF_DEAD) && pos.Z > pp->actor->user.loz - pp->actor->user.floor_dist)
if ((pp->Flags & PF_DEAD) && pos.Z > pp->GetActor()->user.loz - pp->GetActor()->user.floor_dist)
{
pos.Z = pp->actor->user.loz - pp->actor->user.floor_dist;
pos.Z = pp->GetActor()->user.loz - pp->GetActor()->user.floor_dist;
}
else if (pp->Flags & (PF_SWIMMING|PF_DIVING))
{
@ -815,8 +815,8 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
else // Otherwise just interpolate the player sprite
{
pp = tActor->user.PlayerP;
tsp->pos = pp->actor->getRenderPos(interpfrac);
tsp->Angles.Yaw = pp->actor->interpolatedyaw(interpfrac);
tsp->pos = pp->GetActor()->getRenderPos(interpfrac);
tsp->Angles.Yaw = pp->GetActor()->interpolatedyaw(interpfrac);
}
}
@ -880,7 +880,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
{
if ((tActor->user.Flags2 & SPR2_VIS_SHADING))
{
if (Player[screenpeek].actor != tActor)
if (Player[screenpeek].GetActor() != tActor)
{
if (!(tActor->user.PlayerP->Flags & PF_VIEW_FROM_OUTSIDE))
{
@ -972,7 +972,7 @@ void PrintSpriteInfo(PLAYER* pp)
//if (SpriteInfo && !LocationInfo)
{
auto actor = DoPickTarget(pp->actor, DAngle22_5/4, 2);
auto actor = DoPickTarget(pp->GetActor(), DAngle22_5/4, 2);
actor->spr.hitag = 9997; // Special tag to make the actor glow red for one frame
@ -1013,7 +1013,7 @@ void PrintSpriteInfo(PLAYER* pp)
static void DrawCrosshair(PLAYER* pp, const double interpfrac)
{
auto offsets = pp->Angles.getCrosshairOffsets(interpfrac);
::DrawCrosshair(pp->actor->user.Health, offsets.first.X, offsets.first.Y + ((pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0), 2, offsets.second, shadeToLight(10));
::DrawCrosshair(pp->GetActor()->user.Health, offsets.first.X, offsets.first.Y + ((pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0), 2, offsets.second, shadeToLight(10));
}
//---------------------------------------------------------------------------
@ -1231,7 +1231,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
pp->Angles.updateCameraAngles(interpfrac);
// Get initial player position, interpolating if required.
DVector3 tpos = camerapp->actor->getRenderPos(interpfrac);
DVector3 tpos = camerapp->GetActor()->getRenderPos(interpfrac);
DVector2 ampos = tpos.XY();
DRotator tangles = camerapp->Angles.getRenderAngles(interpfrac);
sectortype* tsect = camerapp->cursector;
@ -1242,14 +1242,14 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
{
if (pp->sop_control && (!cl_sointerpolation || (CommEnabled && !pp->sop_remote)))
{
tpos = pp->actor->getPosWithOffsetZ();
tangles.Yaw = pp->actor->spr.Angles.Yaw;
tpos = pp->GetActor()->getPosWithOffsetZ();
tangles.Yaw = pp->GetActor()->spr.Angles.Yaw;
}
tsect = pp->cursector;
updatesectorz(tpos, &tsect);
}
pp->si = tpos.plusZ(-pp->actor->getOffsetZ());
pp->si = tpos.plusZ(-pp->GetActor()->getOffsetZ());
QuakeViewChange(camerapp, tpos, tangles.Yaw);
int vis = g_visibility;
@ -1266,10 +1266,10 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
{
tpos.Z -= 33;
if (!calcChaseCamPos(tpos, pp->actor, &tsect, tangles, interpfrac, 128.))
if (!calcChaseCamPos(tpos, pp->GetActor(), &tsect, tangles, interpfrac, 128.))
{
tpos.Z += 33;
calcChaseCamPos(tpos, pp->actor, &tsect, tangles, interpfrac, 128.);
calcChaseCamPos(tpos, pp->GetActor(), &tsect, tangles, interpfrac, 128.);
}
}
@ -1294,7 +1294,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
UpdatePanel(interpfrac);
UpdateWallPortalState();
render_drawrooms(pp->actor, tpos, tsect, tangles, interpfrac);
render_drawrooms(pp->GetActor(), tpos, tsect, tangles, interpfrac);
RestorePortalState();
if (sceneonly)
@ -1399,7 +1399,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
if (actor->spr.cstat2 & CSTAT2_SPRITE_MAPPED)
{
// 1=white / 31=black / 44=green / 56=pink / 128=yellow / 210=blue / 248=orange / 255=purple
PalEntry col = (actor->spr.cstat & CSTAT_SPRITE_BLOCK) > 0 ? GPalette.BaseColors[248] : actor == Player[screenpeek].actor ? GPalette.BaseColors[31] : GPalette.BaseColors[56];
PalEntry col = (actor->spr.cstat & CSTAT_SPRITE_BLOCK) > 0 ? GPalette.BaseColors[248] : actor == Player[screenpeek].GetActor() ? GPalette.BaseColors[31] : GPalette.BaseColors[56];
auto statnum = actor->spr.statnum;
auto sprxy = ((statnum >= 1) && (statnum <= 8) && (statnum != 2) ? actor->interpolatedpos(interpfrac) : actor->spr.pos).XY() - cpos;
@ -1425,7 +1425,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
if (p == screenpeek)
{
auto pp = &Player[p];
auto actor = pp->actor;
auto actor = pp->GetActor();
if (actor->vel.X > 1) pspr_ndx[myconnectindex] = ((PlayClock >> 4) & 3);
sprisplayer = true;
@ -1437,7 +1437,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
int spnum = -1;
if (sprisplayer)
{
if (gNet.MultiGameType != MULTI_GAME_COMMBAT || actor == Player[screenpeek].actor)
if (gNet.MultiGameType != MULTI_GAME_COMMBAT || actor == Player[screenpeek].GetActor())
spnum = 1196 + pspr_ndx[myconnectindex];
}
else spnum = actor->spr.picnum;

View file

@ -1850,9 +1850,14 @@ struct PLAYER
uint8_t WpnReloadState;
inline DSWActor* GetActor()
{
return actor;
}
void posZset(const double val)
{
actor->spr.pos.Z = val - actor->viewzoffset;
GetActor()->spr.pos.Z = val - GetActor()->viewzoffset;
}
};
@ -1887,7 +1892,7 @@ struct GameInterface : public ::GameInterface
void NextLevel(MapRecord *map, int skill) override;
void NewGame(MapRecord *map, int skill, bool) override;
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
DCoreActor* getConsoleActor() override { return Player[myconnectindex].actor; }
DCoreActor* getConsoleActor() override { return Player[myconnectindex].GetActor(); }
void ToggleThirdPerson() override;
void SwitchCoopView() override;
void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double smoothRatio) override;
@ -1920,7 +1925,7 @@ inline bool SectorIsUnderwaterArea(sectortype* sect)
inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, DAngle range)
{
return absangle((a->spr.pos.XY() - pp->actor->spr.pos.XY()).Angle(), pp->actor->spr.Angles.Yaw) < range;
return absangle((a->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Angle(), pp->GetActor()->spr.Angles.Yaw) < range;
}
inline bool FacingRange(DSWActor* a1, DSWActor* a2, DAngle range)

View file

@ -563,7 +563,7 @@ int DoCheckSwarm(DSWActor* actor)
if (actor->user.targetActor->user.PlayerP)
{
pp = actor->user.targetActor->user.PlayerP;
pdist = (actor->spr.pos.XY() - pp->actor->spr.pos.XY()).LengthSquared();
pdist = (actor->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).LengthSquared();
}
else
return 0;

View file

@ -72,7 +72,7 @@ enum
void processWeapon(PLAYER* const pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
if (plActor == nullptr) return;
int i;

View file

@ -159,7 +159,7 @@ void UseInventoryMedkit(PLAYER* pp)
if (!pp->InventoryAmount[inv])
return;
diff = 100 - pp->actor->user.Health;
diff = 100 - pp->GetActor()->user.Health;
if (diff <= 0)
return;
@ -296,7 +296,7 @@ void UseInventoryRepairKit(PLAYER* pp)
void UseInventoryCloak(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
if (pp->InventoryActive[pp->InventoryNum])
{
@ -321,7 +321,7 @@ void UseInventoryCloak(PLAYER* pp)
void StopInventoryCloak(PLAYER* pp, short InventoryNum)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
pp->InventoryActive[InventoryNum] = false;

View file

@ -385,7 +385,7 @@ void JS_ProcessEchoSpot()
while (auto actor = it.Next())
{
double maxdist = SP_TAG4(actor) * maptoworld;
auto v = actor->spr.pos.XY() - pp->actor->spr.pos.XY();
auto v = actor->spr.pos.XY() - pp->GetActor()->spr.pos.XY();
double dist = abs(v.X) + abs(v.Y);
if (dist <= maxdist) // tag4 = ang
@ -548,7 +548,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio)
// If player is dead still then update at MoveSkip4
// rate.
if (pp->actor->spr.pos == pp->actor->opos)
if (pp->GetActor()->spr.pos == pp->GetActor()->opos)
DoCam = true;
@ -561,7 +561,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio)
if (TEST_BOOL11(camactor) && numplayers > 1)
{
drawroomstotile(cp->actor->getPosWithOffsetZ(), cp->actor->spr.Angles.Yaw, cp->actor->spr.Angles.Pitch, cp->cursector, mirror[cnt].campic, smoothratio);
drawroomstotile(cp->GetActor()->getPosWithOffsetZ(), cp->GetActor()->spr.Angles.Yaw, cp->GetActor()->spr.Angles.Pitch, cp->cursector, mirror[cnt].campic, smoothratio);
}
else
{

View file

@ -1233,7 +1233,7 @@ int DoRadiationCloud(DSWActor* actor)
//////////////////////////////////////////////
int PlayerInitChemBomb(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler);
@ -1241,11 +1241,11 @@ int PlayerInitChemBomb(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, CHEMBOMB, s_ChemBomb, pp->cursector, pos, pp->actor->spr.Angles.Yaw, CHEMBOMB_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, CHEMBOMB, s_ChemBomb, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, CHEMBOMB_VELOCITY);
// don't throw it as far if crawling
if (pp->Flags & (PF_CRAWLING))
@ -1255,7 +1255,7 @@ int PlayerInitChemBomb(PLAYER* pp)
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.5, 0.5);
actorNew->spr.shade = -15;
actorNew->user.WeaponNum = plActor->user.WeaponNum;
@ -1403,7 +1403,7 @@ int PlayerInitFlashBomb(PLAYER* pp)
unsigned int stat;
short damage;
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
PlaySound(DIGI_GASPOP, pp, v3df_dontpan | v3df_doppler);
@ -1415,7 +1415,7 @@ int PlayerInitFlashBomb(PLAYER* pp)
SWStatIterator it(StatDamageList[stat]);
while (auto itActor = it.Next())
{
if (itActor == pp->actor)
if (itActor == pp->GetActor())
break;
double dist = (itActor->spr.pos.XY() - actor->spr.pos.XY()).Length();
@ -1428,7 +1428,7 @@ int PlayerInitFlashBomb(PLAYER* pp)
if (!FAFcansee(itActor->spr.pos, itActor->sector(), actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->sector()))
continue;
damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB);
damage = GetDamage(itActor, pp->GetActor(), DMG_FLASHBOMB);
if (itActor->user.sop_parent)
{
@ -1607,16 +1607,16 @@ void SpawnFlashBombOnActor(DSWActor* actor)
int PlayerInitCaltrops(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler);
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto actorNew = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursector, pos, pp->actor->spr.Angles.Yaw, (CHEMBOMB_VELOCITY + RandomRangeF(CHEMBOMB_VELOCITY)) / 2);
auto actorNew = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, (CHEMBOMB_VELOCITY + RandomRangeF(CHEMBOMB_VELOCITY)) / 2);
// don't throw it as far if crawling
if (pp->Flags & (PF_CRAWLING))
@ -1626,7 +1626,7 @@ int PlayerInitCaltrops(PLAYER* pp)
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(1, 1);
actorNew->spr.shade = -15;
actorNew->user.WeaponNum = plActor->user.WeaponNum;
@ -2182,7 +2182,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
if (actor->user.PlayerP)
{
setFreeAimVelocity(actorNew->vel.X, actorNew->vel.Z, actor->user.PlayerP->actor->spr.Angles.Pitch, HORIZ_MULTF * (1. / 3.));
setFreeAimVelocity(actorNew->vel.X, actorNew->vel.Z, actor->user.PlayerP->GetActor()->spr.Angles.Pitch, HORIZ_MULTF * (1. / 3.));
}
switch (actorNew->user.ID)

View file

@ -59,8 +59,8 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
{
// move the box to position instead of using offset- this prevents small rounding errors
// allowing you to move through wall
DAngle ang = (pp->actor->spr.Angles.Yaw + sop->clipbox_ang[i]);
DVector3 spos(pp->actor->getPosWithOffsetZ(), zz);
DAngle ang = (pp->GetActor()->spr.Angles.Yaw + sop->clipbox_ang[i]);
DVector3 spos(pp->GetActor()->getPosWithOffsetZ(), zz);
DVector2 vect = ang.ToVector() * sop->clipbox_vdist[i];
Collision coll;
@ -73,7 +73,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
min_dist = 0;
min_ndx = i;
// ox is where it should be
opos[i].XY() = pp->actor->getPosWithOffsetZ() + ang.ToVector() * sop->clipbox_vdist[i];
opos[i].XY() = pp->GetActor()->getPosWithOffsetZ() + ang.ToVector() * sop->clipbox_vdist[i];
// spos.x is where it hit
pos[i].XY() = spos.XY();
@ -111,7 +111,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
}
// put posx and y off from offset
pp->actor->spr.pos.XY() += pos[min_ndx].XY() - opos[min_ndx].XY();
pp->GetActor()->spr.pos.XY() += pos[min_ndx].XY() - opos[min_ndx].XY();
return min_ret;
}
@ -133,7 +133,7 @@ int MultiClipTurn(PLAYER* pp, DAngle new_ang, double zz, double floordist)
{
DAngle ang = new_ang + sop->clipbox_ang[i];
DVector3 spos(pp->actor->getPosWithOffsetZ(), zz);
DVector3 spos(pp->GetActor()->getPosWithOffsetZ(), zz);
DVector2 vect = ang.ToVector() * sop->clipbox_vdist[i];
Collision coll;
@ -207,7 +207,7 @@ int RectClipMove(PLAYER* pp, DVector2* qpos)
//Given the 4 points: x[4], y[4]
if (testquadinsect(&point_num, xy, pp->cursector))
{
pp->actor->spr.pos.XY() += pvect;
pp->GetActor()->spr.pos.XY() += pvect;
return true;
}
@ -223,7 +223,7 @@ int RectClipMove(PLAYER* pp, DVector2* qpos)
}
if (testquadinsect(&point_num, xy, pp->cursector))
{
pp->actor->spr.pos.XY() += { -pvect.X * 0.5, pvect.X * 0.5 };
pp->GetActor()->spr.pos.XY() += { -pvect.X * 0.5, pvect.X * 0.5 };
}
return false;
@ -238,7 +238,7 @@ int RectClipMove(PLAYER* pp, DVector2* qpos)
}
if (testquadinsect(&point_num, xy, pp->cursector))
{
pp->actor->spr.pos.XY() += { pvect.X * 0.5, -pvect.X * 0.5 };
pp->GetActor()->spr.pos.XY() += { pvect.X * 0.5, -pvect.X * 0.5 };
}
return false;
@ -264,7 +264,7 @@ short RectClipTurn(PLAYER* pp, DAngle new_angl, DVector2* qpos, DVector2* opos)
rot_angl = new_angl + sop->spin_ang - sop->ang_orig;
for (i = 0; i < 4; i++)
{
xy[i] = rotatepoint(pp->actor->spr.pos.XY(), opos[i], rot_angl);
xy[i] = rotatepoint(pp->GetActor()->spr.pos.XY(), opos[i], rot_angl);
// cannot use sop->xmid and ymid because the SO is off the map at this point
}

View file

@ -66,11 +66,11 @@ void InitNetPlayerOptions(void)
// myconnectindex palette
pp->TeamColor = gs.NetColor;
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
if (actor)
{
actor->spr.pal = PALETTE_PLAYER0 + pp->TeamColor;
pp->actor->user.spal = actor->spr.pal;
pp->GetActor()->user.spal = actor->spr.pal;
}
}

View file

@ -2122,7 +2122,7 @@ void InitAllPlayerSprites(const DVector3& spawnpos, const DAngle startang)
void PlayerLevelReset(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
if (gNet.MultiGameType == MULTI_GAME_COMMBAT)
{
@ -2165,7 +2165,7 @@ void PlayerLevelReset(PLAYER* pp)
void PlayerDeathReset(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
if (pp->Flags & (PF_DIVING))
DoPlayerStopDiveNoWarp(pp);
@ -2243,9 +2243,9 @@ void PlayerPanelSetup(void)
{
auto pp = Player + pnum;
ASSERT(pp->actor->hasU());
ASSERT(pp->GetActor()->hasU());
PlayerUpdateWeapon(pp, pp->actor->user.WeaponNum);
PlayerUpdateWeapon(pp, pp->GetActor()->user.WeaponNum);
}
}
@ -2257,7 +2257,7 @@ void PlayerPanelSetup(void)
void PlayerGameReset(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
COVER_SetReverb(0); // Turn off any echoing that may have been going before
pp->Reverb = 0;
@ -2341,7 +2341,7 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
pp->actor = actor;
pp->pnum = pnum;
pp->Angles.initialize(pp->actor);
pp->Angles.initialize(pp->GetActor());
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actor->spr.extra |= (SPRX_PLAYER_OR_ENEMY);
@ -2368,7 +2368,7 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
actor->spr.pal = PALETTE_PLAYER0 + pp->pnum;
actor->user.spal = actor->spr.pal;
pp->actor->setStateGroup(NAME_Run);
pp->GetActor()->setStateGroup(NAME_Run);
pp->PlayerUnderActor = nullptr;
@ -2406,12 +2406,12 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
void SpawnPlayerUnderSprite(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
int pnum = int(pp - Player);
pp->PlayerUnderActor = SpawnActor(STAT_PLAYER_UNDER0 + pnum,
NINJA_RUN_R0, nullptr, pp->cursector, pp->actor->getPosWithOffsetZ(), pp->actor->spr.Angles.Yaw);
NINJA_RUN_R0, nullptr, pp->cursector, pp->GetActor()->getPosWithOffsetZ(), pp->GetActor()->spr.Angles.Yaw);
DSWActor* actor = pp->PlayerUnderActor;

View file

@ -259,7 +259,7 @@ void ArmorCalc(int damage_amt, int *armor_damage, int *player_damage)
void PlayerUpdateHealth(PLAYER* pp, short value)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
short x,y;
if (Prediction)
@ -413,7 +413,7 @@ void PlayerUpdateAmmo(PLAYER* pp, short UpdateWeaponNum, short value)
void PlayerUpdateWeapon(PLAYER* pp, short WeaponNum)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
// weapon Change
if (Prediction)
@ -447,7 +447,7 @@ void PlayerUpdateKills(PLAYER* pp, short value)
opp = Player + pnum;
// for everyone on the same team
if (opp != pp && opp->actor->user.spal == pp->actor->user.spal)
if (opp != pp && opp->GetActor()->user.spal == pp->GetActor()->user.spal)
{
Level.addFrags(pnum, value);
}
@ -489,7 +489,7 @@ void PlayerUpdateArmor(PLAYER* pp, short value)
int WeaponOperate(PLAYER* pp)
{
short weapon;
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
InventoryKeys(pp);
@ -716,7 +716,7 @@ bool WeaponOK(PLAYER* pp)
static const uint8_t wpn_order[] = {2,3,4,5,6,7,8,9,1,0};
unsigned wpn_ndx=0;
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
if (!plActor || !plActor->hasU())
return(false);
@ -2590,7 +2590,7 @@ void pUziFire(PANEL_SPRITE* psp)
}
else
{
SpawnVis(psp->PlayerP->actor, nullptr, {}, 32);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 32);
if (!WeaponOK(psp->PlayerP))
return;
@ -2705,14 +2705,14 @@ void SpawnUziShell(PANEL_SPRITE* psp)
// LEFT side
pp->UziShellLeftAlt = !pp->UziShellLeftAlt;
if (pp->UziShellLeftAlt)
SpawnShell(pp->actor,-3);
SpawnShell(pp->GetActor(),-3);
}
else
{
// RIGHT side
pp->UziShellRightAlt = !pp->UziShellRightAlt;
if (pp->UziShellRightAlt)
SpawnShell(pp->actor,-2);
SpawnShell(pp->GetActor(),-2);
}
}
@ -2774,7 +2774,7 @@ PANEL_STATE ps_ShotgunShell[] =
void SpawnShotgunShell(PANEL_SPRITE* psp)
{
PLAYER* pp = psp->PlayerP;
SpawnShell(pp->actor,-4);
SpawnShell(pp->GetActor(),-4);
}
void pShotgunShell(PANEL_SPRITE* psp)
@ -3320,7 +3320,7 @@ void pShotgunAction(PANEL_SPRITE* psp)
void pShotgunFire(PANEL_SPRITE* psp)
{
SpawnVis(psp->PlayerP->actor, nullptr, {}, 32);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 32);
InitShotgun(psp->PlayerP);
//SpawnShotgunShell(psp);
}
@ -3752,7 +3752,7 @@ void pRailAction(PANEL_SPRITE* psp)
void pRailFire(PANEL_SPRITE* psp)
{
SpawnVis(psp->PlayerP->actor, nullptr, {}, 16);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 16);
InitRail(psp->PlayerP);
}
@ -3771,7 +3771,7 @@ void pRailRetract(PANEL_SPRITE* psp)
{
psp->PlayerP->Flags &= ~(PF_WEAPON_RETRACT);
psp->PlayerP->Wpn[psp->WeaponType] = nullptr;
DeleteNoSoundOwner(psp->PlayerP->actor);
DeleteNoSoundOwner(psp->PlayerP->GetActor());
pKillSprite(psp);
}
}
@ -4203,15 +4203,15 @@ void pHotheadAttack(PANEL_SPRITE* psp)
switch (psp->PlayerP->WpnFlameType)
{
case 0:
SpawnVis(psp->PlayerP->actor, nullptr, {}, 32);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 32);
InitFireball(psp->PlayerP);
break;
case 1:
SpawnVis(psp->PlayerP->actor, nullptr, {}, 20);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 20);
InitSpellRing(psp->PlayerP);
break;
case 2:
SpawnVis(psp->PlayerP->actor, nullptr, {}, 16);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 16);
InitSpellNapalm(psp->PlayerP);
break;
}
@ -4294,7 +4294,7 @@ void SpawnOnFire(PLAYER* pp)
void pOnFire(PANEL_SPRITE* psp)
{
DSWActor* plActor = psp->PlayerP->actor;
DSWActor* plActor = psp->PlayerP->GetActor();
// Kill immediately - in case of death/water
if (plActor->user.flameActor == nullptr && plActor->user.Flags2 & SPR2_FLAMEDIE)
@ -4827,7 +4827,7 @@ void pMicroAction(PANEL_SPRITE* psp)
void pMicroFire(PANEL_SPRITE* psp)
{
SpawnVis(psp->PlayerP->actor, nullptr, {}, 20);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 20);
switch (psp->PlayerP->WpnRocketType)
{
case 0:
@ -5770,7 +5770,7 @@ void pGrenadeAction(PANEL_SPRITE* psp)
void pGrenadeFire(PANEL_SPRITE* psp)
{
SpawnVis(psp->PlayerP->actor, nullptr, {}, 32);
SpawnVis(psp->PlayerP->GetActor(), nullptr, {}, 32);
InitGrenade(psp->PlayerP);
}
@ -7365,7 +7365,7 @@ void pWeaponBob(PANEL_SPRITE* psp, short condition)
bool DrawBeforeView = false;
void pDisplaySprites(PLAYER* pp, double interpfrac)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
PANEL_SPRITE* next=nullptr;
short shade, picnum, overlay_shade = 0;
double x, y;

File diff suppressed because it is too large Load diff

View file

@ -195,7 +195,7 @@ void QuakeViewChange(PLAYER* pp, DVector3& tpos, DAngle& tang)
SWStatIterator it(STAT_QUAKE_ON);
while ((actor = it.Next()))
{
auto dist = (pp->actor->getPosWithOffsetZ() - actor->spr.pos).Length();
auto dist = (pp->GetActor()->getPosWithOffsetZ() - actor->spr.pos).Length();
// shake whole level
if (QUAKE_TestDontTaper(actor))
@ -277,7 +277,7 @@ void SpawnQuake(sectortype* sect, const DVector3& pos, int tics, int amt, int ra
bool SetQuake(PLAYER* pp, short tics, short amt)
{
SpawnQuake(pp->cursector, pp->actor->getPosWithOffsetZ(), tics, amt, 30000);
SpawnQuake(pp->cursector, pp->GetActor()->getPosWithOffsetZ(), tics, amt, 30000);
return false;
}
@ -295,7 +295,7 @@ int SetGunQuake(DSWActor* actor)
int SetPlayerQuake(PLAYER* pp)
{
SpawnQuake(pp->cursector, pp->actor->getPosWithOffsetZ(), 40, 8, 40000);
SpawnQuake(pp->cursector, pp->GetActor()->getPosWithOffsetZ(), 40, 8, 40000);
return 0;
}

View file

@ -1518,7 +1518,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating)
{
pp = GlobPlayerP;
if (!FAFcansee(pp->actor->getPosWithOffsetZ(), pp->cursector, actor->spr.pos.plusZ(ActorSizeZ(actor) * -0.5), actor->sector()))
if (!FAFcansee(pp->GetActor()->getPosWithOffsetZ(), pp->cursector, actor->spr.pos.plusZ(ActorSizeZ(actor) * -0.5), actor->sector()))
return false;
}
@ -1996,9 +1996,9 @@ void OperateTripTrigger(PLAYER* pp)
{
if (actor->user.Flags & (SPR_WAIT_FOR_TRIGGER))
{
if ((actor->spr.pos.XY() - pp->actor->spr.pos.XY()).Length() < dist)
if ((actor->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Length() < dist)
{
actor->user.targetActor = pp->actor;
actor->user.targetActor = pp->GetActor();
actor->user.Flags &= ~(SPR_WAIT_FOR_TRIGGER);
}
}
@ -2076,7 +2076,7 @@ void OperateContinuousTrigger(PLAYER* pp)
short PlayerTakeSectorDamage(PLAYER* pp)
{
auto sectu = pp->cursector;
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
// the calling routine must make sure sectu exists
if ((actor->user.DamageTics -= synctics) < 0)
@ -2109,7 +2109,7 @@ bool NearThings(PLAYER* pp)
return false;
}
neartag(pp->actor->getPosWithOffsetZ(), pp->cursector, pp->actor->spr.Angles.Yaw, near, 64., NT_Lotag | NT_Hitag);
neartag(pp->GetActor()->getPosWithOffsetZ(), pp->cursector, pp->GetActor()->spr.Angles.Yaw, near, 64., NT_Lotag | NT_Hitag);
// hit a sprite? Check to see if it has sound info in it!
@ -2142,12 +2142,12 @@ bool NearThings(PLAYER* pp)
{
HitInfo hit{};
FAFhitscan(pp->actor->getPosWithOffsetZ().plusZ(-30), pp->cursector, DVector3(pp->actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE);
FAFhitscan(pp->GetActor()->getPosWithOffsetZ().plusZ(-30), pp->cursector, DVector3(pp->GetActor()->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE);
if (hit.hitSector == nullptr)
return false;
if ((hit.hitpos.XY() - pp->actor->spr.pos.XY()).Length() > 93.75)
if ((hit.hitpos.XY() - pp->GetActor()->spr.pos.XY()).Length() > 93.75)
return false;
// hit a sprite?
@ -2190,7 +2190,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, double z, double dist, int typ
HitInfo near;
neartag(DVector3(pp->actor->spr.pos.XY(), z), pp->cursector, pp->actor->spr.Angles.Yaw, near, dist, type);
neartag(DVector3(pp->GetActor()->spr.pos.XY(), z), pp->cursector, pp->GetActor()->spr.Angles.Yaw, near, dist, type);
if (near.hitSector != nullptr)
{
@ -2315,7 +2315,7 @@ int DoPlayerGrabStar(PLAYER* pp)
auto actor = StarQueue[i];
if (actor != nullptr)
{
if ((actor->spr.pos - pp->actor->getPosWithOffsetZ()).plusZ(12).Length() < 31.25)
if ((actor->spr.pos - pp->GetActor()->getPosWithOffsetZ()).plusZ(12).Length() < 31.25)
{
break;
}
@ -2349,7 +2349,7 @@ void PlayerOperateEnv(PLAYER* pp)
{
bool found;
if (Prediction || !pp->actor)
if (Prediction || !pp->GetActor())
return;
//
@ -2373,7 +2373,7 @@ void PlayerOperateEnv(PLAYER* pp)
NearThings(pp); // Check for player sound specified in a level sprite
}
BuildNearTagList(nti, sizeof(nti), pp, pp->actor->getOffsetZ(), 128, NT_Lotag | NT_Hitag, 8);
BuildNearTagList(nti, sizeof(nti), pp, pp->GetActor()->getOffsetZ(), 128, NT_Lotag | NT_Hitag, 8);
found = false;
@ -2394,7 +2394,7 @@ void PlayerOperateEnv(PLAYER* pp)
if (!found)
{
double z[3];
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
z[0] = plActor->spr.pos.Z - ActorSizeZ(plActor) - 10;
z[1] = plActor->spr.pos.Z;
@ -2484,14 +2484,14 @@ void PlayerOperateEnv(PLAYER* pp)
{
PlayerTakeSectorDamage(pp);
}
else if ((ActorZOfBottom(pp->actor) >= sectp->floorz) && !(pp->Flags & PF_DIVING))
else if ((ActorZOfBottom(pp->GetActor()) >= sectp->floorz) && !(pp->Flags & PF_DIVING))
{
PlayerTakeSectorDamage(pp);
}
}
else
{
pp->actor->user.DamageTics = 0;
pp->GetActor()->user.DamageTics = 0;
}
@ -2904,7 +2904,7 @@ void DoSector(void)
}
else
{
double dist = (pp->actor->spr.pos.XY() - sop->pmid.XY()).Length();
double dist = (pp->GetActor()->spr.pos.XY() - sop->pmid.XY()).Length();
if (dist < min_dist)
min_dist = dist;
}

View file

@ -108,7 +108,7 @@ short SoundDist(const DVector3& pos, double basedist)
double sqrdist;
extern short screenpeek;
double distance = (Player[screenpeek].actor->getPosWithOffsetZ() - pos).Length() * 16;
double distance = (Player[screenpeek].GetActor()->getPosWithOffsetZ() - pos).Length() * 16;
if (basedist < 0) // if basedist is negative
{
@ -325,7 +325,7 @@ static void UpdateAmbients()
if (sdist < 255 && sfx->ResourceId == DIGI_WHIPME)
{
PLAYER* pp = Player + screenpeek;
if (!FAFcansee(spot->spr.pos, spot->sector(), pp->actor->getPosWithOffsetZ(), pp->cursector))
if (!FAFcansee(spot->spr.pos, spot->sector(), pp->GetActor()->getPosWithOffsetZ(), pp->cursector))
{
sdist = 255;
}
@ -426,7 +426,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
if (pos != nullptr)
{
PLAYER* pp = Player + screenpeek;
FVector3 campos = GetSoundPos(pp->actor ? pp->actor->getPosWithOffsetZ() : DVector3());
FVector3 campos = GetSoundPos(pp->GetActor() ? pp->GetActor()->getPosWithOffsetZ() : DVector3());
DVector3 vPos = {};
bool pancheck = false;
@ -446,10 +446,10 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
}
else
{
auto act = ((PLAYER*)source)->actor;
auto act = ((PLAYER*)source)->GetActor();
if (act) vPos = act->getPosWithOffsetZ();
else if (pp->actor)
vPos = pp->actor->getPosWithOffsetZ();
else if (pp->GetActor())
vPos = pp->GetActor()->getPosWithOffsetZ();
}
pancheck = true;
FVector3 npos = GetSoundPos(vPos);
@ -479,7 +479,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, spot->sector(), pp->actor->getPosWithOffsetZ(), pp->cursector))
if (!FAFcansee(vPos, spot->sector(), pp->GetActor()->getPosWithOffsetZ(), pp->cursector))
{
auto distvec = npos - campos;
npos = campos + distvec * 1.75f; // Play more quietly
@ -523,13 +523,13 @@ void GameInterface::UpdateSounds(void)
if (rsp && TEST_BOOL1(rsp))
tang = rsp->spr.Angles.Yaw;
else
tang = (pp->sop_remote->pmid.XY() - pp->actor->spr.pos.XY()).Angle();
tang = (pp->sop_remote->pmid.XY() - pp->GetActor()->spr.pos.XY()).Angle();
}
else tang = pp->actor ? pp->actor->spr.Angles.Yaw : nullAngle;
else tang = pp->GetActor() ? pp->GetActor()->spr.Angles.Yaw : nullAngle;
listener.angle = float(-tang.Radians());
listener.velocity.Zero();
listener.position = GetSoundPos(pp->actor ? pp->actor->getPosWithOffsetZ() : DVector3());
listener.position = GetSoundPos(pp->GetActor() ? pp->GetActor()->getPosWithOffsetZ() : DVector3());
listener.underwater = false;
// This should probably use a real environment instead of the pitch hacking in S_PlaySound3D.
// listenactor->waterlevel == 3;
@ -573,7 +573,7 @@ int _PlaySound(const FSoundID sndid, DSWActor* actor, PLAYER* pp, const DVector3
}
else if (pp && !ppos)
{
pos = pp->actor->getPosWithOffsetZ();
pos = pp->GetActor()->getPosWithOffsetZ();
pp = nullptr;
sourcetype = SOURCE_Unattached;
}

View file

@ -774,7 +774,7 @@ void SpawnUser(DSWActor* actor, short id, STATE* state)
actor->user.WpnGoalActor = nullptr;
actor->user.attachActor = nullptr;
actor->user.track = -1;
actor->user.targetActor = Player[0].actor;
actor->user.targetActor = Player[0].GetActor();
actor->user.Radius = 220;
actor->user.Sibling = -1;
actor->user.WaitTics = 0;
@ -4999,26 +4999,26 @@ int DoGet(DSWActor* actor)
TRAVERSE_CONNECT(pnum)
{
pp = &Player[pnum];
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
int weaponswitch = WeaponSwitch(pnum);
if (pp->Flags & (PF_DEAD))
continue;
double dist = (pp->actor->spr.pos.XY() - actor->spr.pos).Length();
double dist = (pp->GetActor()->spr.pos.XY() - actor->spr.pos).Length();
if ((unsigned)dist > (plActor->user.fRadius() + actor->user.fRadius()))
{
continue;
}
if (!SpriteOverlap(actor, pp->actor))
if (!SpriteOverlap(actor, pp->GetActor()))
{
continue;
}
auto cstat_bak = actor->spr.cstat;
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
can_see = FAFcansee(actor->spr.pos, actor->sector(), pp->actor->getPosWithOffsetZ(), pp->cursector);
can_see = FAFcansee(actor->spr.pos, actor->sector(), pp->GetActor()->getPosWithOffsetZ(), pp->cursector);
actor->spr.cstat = cstat_bak;
if (!can_see)
@ -5800,7 +5800,7 @@ KeyMain:
case ICON_FLAG:
{
if (actor->spr.pal == pp->actor->spr.pal) break; // Can't pick up your own flag!
if (actor->spr.pal == pp->GetActor()->spr.pal) break; // Can't pick up your own flag!
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
@ -5816,11 +5816,11 @@ KeyMain:
actorNew->user.Counter = 0;
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
SetAttach(pp->actor, actorNew);
actorNew->user.pos.Z = ActorZOfMiddle(pp->actor); // Set mid way up who it hit
SetAttach(pp->GetActor(), actorNew);
actorNew->user.pos.Z = ActorZOfMiddle(pp->GetActor()); // Set mid way up who it hit
actorNew->user.spal = actorNew->spr.pal = actor->spr.pal; // Set the palette of the flag
SetOwner(pp->actor, actorNew); // Player now owns the flag
SetOwner(pp->GetActor(), actorNew); // Player now owns the flag
actorNew->user.flagOwnerActor = actor; // Tell carried flag who owns it
KillGet(actor); // Set up for flag respawning
break;
@ -5867,7 +5867,7 @@ void ProcessActiveVars(DSWActor* actor)
void AdjustActiveRange(PLAYER* pp, DSWActor* actor, double dist)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
// do no FAFcansee before it is time
if (actor->user.wait_active_check < ACTIVE_CHECK_TIME)
@ -6050,7 +6050,7 @@ void SpriteControl(void)
pp = &Player[pnum];
// Only update the ones closest
double dist = (pp->actor->spr.pos.XY() - actor->spr.pos.XY()).Length();
double dist = (pp->GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length();
AdjustActiveRange(pp, actor, dist);

View file

@ -738,7 +738,7 @@ void BossHealthMeter(void)
DSWActor* actor = BossSpriteNum[i];
if (actor != nullptr && !bosswasseen[i])
{
if (cansee(ActorVectOfTop(actor), actor->sector(), pp->actor->getPosWithOffsetZ().plusZ(-40), pp->cursector))
if (cansee(ActorVectOfTop(actor), actor->sector(), pp->GetActor()->getPosWithOffsetZ().plusZ(-40), pp->cursector))
{
if (i == 0 && !bosswasseen[0])
{

View file

@ -1469,14 +1469,14 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, const DVector2& move)
{
pp->Flags |= (PF_PLAYER_RIDING);
pp->RevolveAng = pp->actor->spr.Angles.Yaw;
pp->Revolve.XY() = pp->actor->spr.pos.XY();
pp->RevolveAng = pp->GetActor()->spr.Angles.Yaw;
pp->Revolve.XY() = pp->GetActor()->spr.pos.XY();
// set the delta angle to 0 when moving
pp->RevolveDeltaAng = nullAngle;
}
pp->actor->spr.pos.XY() += move;
pp->GetActor()->spr.pos.XY() += move;
if ((sop->flags & SOBJ_DONT_ROTATE))
{
@ -1491,8 +1491,8 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, const DVector2& move)
// save the current information so when Player stops
// moving then you
// know where he was last
pp->RevolveAng = pp->actor->spr.Angles.Yaw;
pp->Revolve.XY() = pp->actor->spr.pos.XY();
pp->RevolveAng = pp->GetActor()->spr.Angles.Yaw;
pp->Revolve.XY() = pp->GetActor()->spr.pos.XY();
// set the delta angle to 0 when moving
pp->RevolveDeltaAng = nullAngle;
@ -1505,20 +1505,20 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, const DVector2& move)
pp->Revolve += move;
// Last known angle is now adjusted by the delta angle
pp->RevolveAng = deltaangle(pp->RevolveDeltaAng, pp->actor->spr.Angles.Yaw);
pp->RevolveAng = deltaangle(pp->RevolveDeltaAng, pp->GetActor()->spr.Angles.Yaw);
}
// increment Players delta angle
pp->RevolveDeltaAng += GlobSpeedSO;
pp->actor->spr.pos.XY() = rotatepoint(sop->pmid.XY(), pp->Revolve.XY(), pp->RevolveDeltaAng);
pp->GetActor()->spr.pos.XY() = rotatepoint(sop->pmid.XY(), pp->Revolve.XY(), pp->RevolveDeltaAng);
// THIS WAS CAUSING PROLEMS!!!!
// Sectors are still being manipulated so you can end up in a void (-1) sector
// New angle is formed by taking last known angle and
// adjusting by the delta angle
pp->actor->spr.Angles.Yaw = (pp->RevolveAng + pp->RevolveDeltaAng).Normalized360();
pp->GetActor()->spr.Angles.Yaw = (pp->RevolveAng + pp->RevolveDeltaAng).Normalized360();
UpdatePlayerSprite(pp);
}
@ -1724,7 +1724,7 @@ PlayerPart:
// prevents you from falling into map HOLEs created by moving
// Sectors and sprites around.
//if (!SO_EMPTY(sop))
updatesector(pp->actor->getPosWithOffsetZ(), &pp->cursector);
updatesector(pp->GetActor()->getPosWithOffsetZ(), &pp->cursector);
// in case you are in a whirlpool
// move perfectly with the ride in the z direction
@ -3335,9 +3335,9 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
{
pp = &Player[pnum];
if ((actor->spr.pos.XY() - pp->actor->spr.pos.XY()).Length() < actor->user.Dist)
if ((actor->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Length() < actor->user.Dist)
{
actor->user.targetActor = pp->actor;
actor->user.targetActor = pp->GetActor();
actor->user.Flags &= ~(SPR_WAIT_FOR_PLAYER);
return true;
}

View file

@ -106,7 +106,7 @@ void VisViewChange(PLAYER* pp, int *vis)
}
// save off the brightest vis that you can see
if (FAFcansee(pp->actor->getPosWithOffsetZ(), pp->cursector, pos, sectp))
if (FAFcansee(pp->GetActor()->getPosWithOffsetZ(), pp->cursector, pos, sectp))
{
if (VIS_VisCur(actor) < BrightestVis)
BrightestVis = VIS_VisCur(actor);

View file

@ -5198,7 +5198,7 @@ int GetDamage(DSWActor* actor, DSWActor* weapActor, int DamageNdx)
int PlayerCheckDeath(PLAYER* pp, DSWActor* weapActor)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
// Store off what player was struck by
pp->HitBy = weapActor;
@ -5268,7 +5268,7 @@ bool PlayerTakeDamage(PLAYER* pp, DSWActor* weapActor)
if (weapActor == nullptr)
return true;
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
auto weapOwner = GetOwner(weapActor);
@ -5278,7 +5278,7 @@ bool PlayerTakeDamage(PLAYER* pp, DSWActor* weapActor)
if (weapActor->user.ID == ZOMBIE_RUN_R0)
{
// if weapons Owner the player
if (weapOwner == pp->actor)
if (weapOwner == pp->GetActor())
return false;
}
@ -11247,7 +11247,7 @@ int DoRing(DSWActor* actor)
double z;
// move the center with the player
if (pp)
z = pp->actor->getOffsetZ() + 20;
z = pp->GetActor()->getOffsetZ() + 20;
else
z = ActorZOfMiddle(own) + 30;
@ -11331,7 +11331,7 @@ void InitSpellRing(PLAYER* pp)
DAngle ang_diff = DAngle360 / max_missiles;
DAngle ang_start = pp->actor->spr.Angles.Yaw - DAngle180;
DAngle ang_start = pp->GetActor()->spr.Angles.Yaw - DAngle180;
if (!SW_SHAREWARE)
PlaySound(DIGI_RFWIZ, pp, v3df_none);
@ -11341,11 +11341,11 @@ 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->actor->getPosWithOffsetZ(), ang, 0);
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, FIREBALL1, s_Ring, pp->cursector, pp->GetActor()->getPosWithOffsetZ(), ang, 0);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
actorNew->vel.X = 31.25;
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(0.5, 0.5);
actorNew->vel.Z = 0;
@ -11359,7 +11359,7 @@ void InitSpellRing(PLAYER* pp)
// put it out there
actorNew->spr.pos += actorNew->spr.Angles.Yaw.ToVector() * actorNew->user.Dist;
actorNew->spr.pos.Z += pp->actor->getOffsetZ() + 20 - (actorNew->user.Dist * pp->Angles.getPitchWithView().Tan() * 2.); // horizon math sucks...
actorNew->spr.pos.Z += pp->GetActor()->getOffsetZ() + 20 - (actorNew->user.Dist * pp->Angles.getPitchWithView().Tan() * 2.); // horizon math sucks...
actorNew->spr.Angles.Yaw += DAngle90;
@ -11692,7 +11692,7 @@ int InitSerpRing(DSWActor* actor)
void InitSpellNapalm(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
unsigned i;
short ammo;
@ -11718,7 +11718,7 @@ void InitSpellNapalm(PLAYER* pp)
for (i = 0; i < SIZ(mp); i++)
{
auto actor = SpawnActor(STAT_MISSILE, FIREBALL1, s_Napalm, pp->cursector,
pp->actor->getPosWithOffsetZ().plusZ(12), pp->actor->spr.Angles.Yaw, NAPALM_VELOCITY*2);
pp->GetActor()->getPosWithOffsetZ().plusZ(12), pp->GetActor()->spr.Angles.Yaw, NAPALM_VELOCITY*2);
actor->spr.hitag = LUMINOUS; //Always full brightness
@ -11727,7 +11727,7 @@ void InitSpellNapalm(PLAYER* pp)
PlaySound(DIGI_NAPWIZ, actor, v3df_follow);
}
SetOwner(pp->actor, actor);
SetOwner(pp->GetActor(), actor);
actor->spr.shade = -40;
actor->spr.scale = DVector2(0.5, 0.5);
actor->clipdist = 0;
@ -11853,11 +11853,11 @@ int InitSpellMirv(PLAYER* pp)
if (!pp->insector())
return 0;
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Mirv, pp->cursector, pp->actor->getPosWithOffsetZ().plusZ(12), pp->actor->spr.Angles.Yaw, MIRV_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Mirv, pp->cursector, pp->GetActor()->getPosWithOffsetZ().plusZ(12), pp->GetActor()->spr.Angles.Yaw, MIRV_VELOCITY);
PlaySound(DIGI_MIRVWIZ, actorNew, v3df_follow);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(1.125, 1.125);
actorNew->clipdist = 2;
@ -11869,7 +11869,7 @@ int InitSpellMirv(PLAYER* pp)
actorNew->user.ceiling_dist = (16);
actorNew->user.Dist = 12.5;
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
auto oclipdist = plActor->clipdist;
plActor->clipdist = 0;
@ -11927,7 +11927,7 @@ int InitEnemyMirv(DSWActor* actor)
int InitSwordAttack(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
unsigned stat;
DAngle face;
@ -11945,7 +11945,7 @@ int InitSwordAttack(PLAYER* pp)
for (size_t i = 0; i < countof(dangs); i++)
{
if (RandomRange(1000) < 500) continue; // Don't spawn bubbles every time
bubble = SpawnBubble(pp->actor);
bubble = SpawnBubble(pp->GetActor());
if (bubble != nullptr)
{
bubble->spr.Angles.Yaw = plActor->spr.Angles.Yaw;
@ -11975,16 +11975,16 @@ int InitSwordAttack(PLAYER* pp)
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
double dist = (pp->actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
double dist = (pp->GetActor()->spr.pos.XY() - itActor->spr.pos.XY()).Length();
face = mapangle(200);
if (dist < CloseRangeDist(itActor, plActor, 62.5) && PlayerFacingRange(pp, itActor, face))
{
if (SpriteOverlapZ(pp->actor, itActor, 20))
if (SpriteOverlapZ(pp->GetActor(), itActor, 20))
{
if (FAFcansee(ActorVectOfMiddle(itActor), itActor->sector(), ActorVectOfMiddle(plActor), plActor->sector()))
DoDamage(itActor, pp->actor);
DoDamage(itActor, pp->GetActor());
}
}
}
@ -11995,14 +11995,14 @@ int InitSwordAttack(PLAYER* pp)
HitInfo hit{};
double dax = 1024., daz = 0;
DAngle daang = pp->actor->spr.Angles.Yaw;
DAngle daang = pp->GetActor()->spr.Angles.Yaw;
setFreeAimVelocity(dax, daz, pp->Angles.getPitchWithView(), 1000. - (RandomRangeF(24000 / 256.) - 12000 / 256.));
FAFhitscan(pp->actor->getPosWithOffsetZ(), pp->cursector, DVector3(pp->actor->spr.Angles.Yaw.ToVector() * dax, daz), hit, CLIPMASK_MISSILE);
FAFhitscan(pp->GetActor()->getPosWithOffsetZ(), pp->cursector, DVector3(pp->GetActor()->spr.Angles.Yaw.ToVector() * dax, daz), hit, CLIPMASK_MISSILE);
if (hit.hitSector == nullptr)
return 0;
if ((pp->actor->getPosWithOffsetZ() - hit.hitpos).Length() < 43.75)
if ((pp->GetActor()->getPosWithOffsetZ() - hit.hitpos).Length() < 43.75)
{
if (hit.actor() != nullptr)
@ -12073,7 +12073,7 @@ int InitSwordAttack(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK)
{
HitBreakWall(hit.hitWall, hit.hitpos, pp->actor->spr.Angles.Yaw, plActor->user.ID);
HitBreakWall(hit.hitWall, hit.hitpos, pp->GetActor()->spr.Angles.Yaw, plActor->user.ID);
}
// hit non breakable wall - do sound and puff
else
@ -12095,7 +12095,7 @@ int InitSwordAttack(PLAYER* pp)
int InitFistAttack(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
unsigned stat;
double reach;
DAngle face;
@ -12113,7 +12113,7 @@ int InitFistAttack(PLAYER* pp)
for (size_t i = 0; i < countof(dangs); i++)
{
bubble = SpawnBubble(pp->actor);
bubble = SpawnBubble(pp->GetActor());
if (bubble != nullptr)
{
bubble->spr.Angles.Yaw = plActor->spr.Angles.Yaw;
@ -12140,7 +12140,7 @@ int InitFistAttack(PLAYER* pp)
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
double dist = (pp->actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
double dist = (pp->GetActor()->spr.pos.XY() - itActor->spr.pos.XY()).Length();
bool iactive = pp->InventoryActive[2];
if (iactive) // Shadow Bombs give you demon fist
{
@ -12155,7 +12155,7 @@ int InitFistAttack(PLAYER* pp)
if (dist < CloseRangeDist(itActor, plActor, reach) && PlayerFacingRange(pp, itActor, face))
{
if (SpriteOverlapZ(pp->actor, itActor, 20) || iactive)
if (SpriteOverlapZ(pp->GetActor(), itActor, 20) || iactive)
{
if (FAFcansee(ActorVectOfMiddle(itActor), itActor->sector(), ActorVectOfMiddle(plActor), plActor->sector()))
DoDamage(itActor, plActor);
@ -12173,14 +12173,14 @@ int InitFistAttack(PLAYER* pp)
{
HitInfo hit{};
double dax = 1024., daz = 0;
auto daang = pp->actor->spr.Angles.Yaw;
auto daang = pp->GetActor()->spr.Angles.Yaw;
setFreeAimVelocity(dax, daz, pp->Angles.getPitchWithView(), 1000. - (RandomRangeF(24000 / 256.) - 12000 / 256.));
FAFhitscan(pp->actor->getPosWithOffsetZ(), pp->cursector, DVector3(pp->actor->spr.Angles.Yaw.ToVector() * dax, daz), hit, CLIPMASK_MISSILE);
FAFhitscan(pp->GetActor()->getPosWithOffsetZ(), pp->cursector, DVector3(pp->GetActor()->spr.Angles.Yaw.ToVector() * dax, daz), hit, CLIPMASK_MISSILE);
if (hit.hitSector == nullptr)
return 0;
if ((pp->actor->getPosWithOffsetZ() - hit.hitpos).Length() < 43.75)
if ((pp->GetActor()->getPosWithOffsetZ() - hit.hitpos).Length() < 43.75)
{
if (hit.actor() != nullptr)
@ -12264,7 +12264,7 @@ int InitFistAttack(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK)
{
HitBreakWall(hit.hitWall, hit.hitpos, pp->actor->spr.Angles.Yaw, plActor->user.ID);
HitBreakWall(hit.hitWall, hit.hitpos, pp->GetActor()->spr.Angles.Yaw, plActor->user.ID);
}
// hit non breakable wall - do sound and puff
else
@ -12709,7 +12709,7 @@ void WeaponHitscanShootFeet(DSWActor* actor, DSWActor* hitActor, double *zvect)
int InitStar(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
static DAngle dang[] = { mapangle(-12), mapangle(12) };
const double STAR_REPEAT = 0.40625;
@ -12722,14 +12722,14 @@ int InitStar(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, pos, pp->actor->spr.Angles.Yaw, STAR_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, STAR_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(STAR_REPEAT, STAR_REPEAT);
actorNew->spr.shade = -25;
actorNew->clipdist = 2;
@ -12755,7 +12755,7 @@ int InitStar(PLAYER* pp)
return 0;
}
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5/4, false) != -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5/4, false) != -1)
{
zvel = actorNew->vel.Z;
}
@ -12813,7 +12813,7 @@ int InitStar(PLAYER* pp)
void InitHeartAttack(PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
short i = 0;
static const MISSILE_PLACEMENT mp[] =
@ -12827,11 +12827,11 @@ void InitHeartAttack(PLAYER* pp)
return;
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, BLOOD_WORM, s_BloodWorm, pp->cursector,
pp->actor->getPosWithOffsetZ().plusZ(12), pp->actor->spr.Angles.Yaw, BLOOD_WORM_VELOCITY*2);
pp->GetActor()->getPosWithOffsetZ().plusZ(12), pp->GetActor()->spr.Angles.Yaw, BLOOD_WORM_VELOCITY*2);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.shade = -10;
actorNew->spr.scale = DVector2(0.8125, 0.8125);
actorNew->clipdist = 0;
@ -12867,7 +12867,7 @@ void InitHeartAttack(PLAYER* pp)
int ContinueHitscan(PLAYER* pp, sectortype* sect, const DVector3& start, DAngle ang, const DVector3& vect)
{
HitInfo hit{};
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
FAFhitscan(start, sect, vect, hit, CLIPMASK_MISSILE);
@ -12926,7 +12926,7 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, const DVector3& start, DAngle
return 0;
}
if (BulletHitSprite(pp->actor, hit.actor(), hit.hitpos, 0))
if (BulletHitSprite(pp->GetActor(), hit.actor(), hit.hitpos, 0))
return 0;
// hit a switch?
@ -12950,7 +12950,7 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, const DVector3& start, DAngle
int InitShotgun(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
HitInfo hit{};
short cstat = 0;
@ -12970,15 +12970,15 @@ int InitShotgun(PLAYER* pp)
}
}
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z);
double dax = 1024.;
double daz = pos.Z;
DAngle daang = DAngle22_5 * 0.5;
if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) == nullptr)
if (WeaponAutoAimHitscan(pp->GetActor(), &daz, &daang, false) == nullptr)
{
setFreeAimVelocity(dax, daz, pp->Angles.getPitchWithView(), 1000.);
daang = pp->actor->spr.Angles.Yaw;
daang = pp->GetActor()->spr.Angles.Yaw;
}
double ndaz;
@ -13090,7 +13090,7 @@ int InitShotgun(PLAYER* pp)
continue;
}
if (BulletHitSprite(pp->actor, hitActor, hit.hitpos, SHOTGUN_SMOKE))
if (BulletHitSprite(pp->GetActor(), hitActor, hit.hitpos, SHOTGUN_SMOKE))
continue;
// hit a switch?
@ -13116,7 +13116,7 @@ int InitShotgun(PLAYER* pp)
int InitLaser(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
DoPlayerBeginRecoil(pp, RAIL_RECOIL_AMT);
PlayerUpdateAmmo(pp, actor->user.WeaponNum, -1);
@ -13125,15 +13125,15 @@ int InitLaser(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector, pos, pp->actor->spr.Angles.Yaw, 18.75);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, 18.75);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.8125, 0.8125);
actorNew->spr.shade = -15;
actorNew->clipdist = 4;
@ -13189,7 +13189,7 @@ int InitLaser(PLAYER* pp)
actor->clipdist = oclipdist;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(5);
}
@ -13206,7 +13206,7 @@ int InitLaser(PLAYER* pp)
int InitRail(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
double zvel;
if (SW_SHAREWARE) return false; // JBF: verify
@ -13223,15 +13223,15 @@ int InitRail(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 11);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 11);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector, pos, pp->actor->spr.Angles.Yaw, 75);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, 75);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.8125, 0.8125);
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, zvel, pp->Angles.getPitchWithView(), (HORIZ_MULT + 17) * 0.5);
@ -13269,7 +13269,7 @@ int InitRail(PLAYER* pp)
actor->clipdist = oclipdist;
actorNew->vel.Z = zvel * 0.5;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(4);
}
@ -13363,7 +13363,7 @@ int InitZillaRail(DSWActor* actor)
int InitRocket(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
double zvel;
DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT);
@ -13388,14 +13388,14 @@ int InitRocket(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, pos, pp->actor->spr.Angles.Yaw, ROCKET_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, ROCKET_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(1.40626, 1.40625);
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, zvel, pp->Angles.getPitchWithView(), (HORIZ_MULT + 35) * 0.5);
@ -13452,7 +13452,7 @@ int InitRocket(PLAYER* pp)
actor->clipdist = oclipdist;
actorNew->vel.Z = zvel * 0.5;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(5);
}
@ -13473,7 +13473,7 @@ int InitRocket(PLAYER* pp)
int InitBunnyRocket(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
double zvel;
DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT);
@ -13495,14 +13495,14 @@ int InitBunnyRocket(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector, pos, pp->actor->spr.Angles.Yaw, ROCKET_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, ROCKET_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(1, 1);
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, zvel, pp->Angles.getPitchWithView(), (HORIZ_MULT + 35) * 0.5);
@ -13556,7 +13556,7 @@ int InitBunnyRocket(PLAYER* pp)
actor->clipdist = oclipdist;
actorNew->vel.Z = zvel * 0.5;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(5);
}
@ -13578,7 +13578,7 @@ int InitBunnyRocket(PLAYER* pp)
int InitNuke(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
double zvel;
if (pp->WpnRocketNuke > 0)
@ -13597,14 +13597,14 @@ int InitNuke(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, pos, pp->actor->spr.Angles.Yaw, 700/16.);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, 700/16.);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(2, 2);
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, zvel, pp->Angles.getPitchWithView(), (HORIZ_MULT + 36) * 0.5);
@ -13649,7 +13649,7 @@ int InitNuke(PLAYER* pp)
actor->clipdist = oclipdist;
actorNew->vel.Z = zvel * 0.5;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(5);
}
@ -13659,7 +13659,7 @@ int InitNuke(PLAYER* pp)
UpdateChangeXY(actorNew);
actorNew->user.change.Z = zvel;
PlayerDamageSlide(pp, -40, pp->actor->spr.Angles.Yaw + DAngle180); // Recoil slide
PlayerDamageSlide(pp, -40, pp->GetActor()->spr.Angles.Yaw + DAngle180); // Recoil slide
return 0;
}
@ -13745,7 +13745,7 @@ int InitEnemyNuke(DSWActor* actor)
int InitMicro(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
short i;
DAngle angle;
TARGET_SORT* ts = TargetSort;
@ -13754,7 +13754,7 @@ int InitMicro(PLAYER* pp)
const int MAX_MICRO = 1;
DoPickTarget(pp->actor, DAngle45, false);
DoPickTarget(pp->GetActor(), DAngle45, false);
if (TargetSortCount > MAX_MICRO)
TargetSortCount = MAX_MICRO;
@ -13771,24 +13771,24 @@ int InitMicro(PLAYER* pp)
{
picked = ts->actor;
angle = (picked->spr.pos.XY() - pp->actor->spr.pos.XY()).Angle();
angle = (picked->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Angle();
ts++;
}
else
{
picked = nullptr;
angle = pp->actor->spr.Angles.Yaw;
angle = pp->GetActor()->spr.Angles.Yaw;
}
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 4 + RandomRange(20));
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 4 + RandomRange(20));
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], pp->cursector, pos, angle, vel);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.375, 0.375);
actorNew->spr.shade = -15;
actorNew->vel.Z = zvel;
@ -14438,7 +14438,7 @@ int InitEnemyRail(DSWActor* actor)
TRAVERSE_CONNECT(pnum)
{
pp = &Player[pnum];
if (actor->user.targetActor == pp->actor)
if (actor->user.targetActor == pp->GetActor())
return 0;
}
}
@ -14964,7 +14964,7 @@ int InitTracerUzi(PLAYER* pp)
if (!pp->insector())
return 0;
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
static const short lat_dist[] = {800,-800};
@ -14973,10 +14973,10 @@ int InitTracerUzi(PLAYER* pp)
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, pp->cursector, pp->actor->getPosWithOffsetZ().plusZ(nz), pp->actor->spr.Angles.Yaw, TRACER_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, pp->cursector, pp->GetActor()->getPosWithOffsetZ().plusZ(nz), pp->GetActor()->spr.Angles.Yaw, TRACER_VELOCITY);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.15625, 0.15625);
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
@ -14989,7 +14989,7 @@ int InitTracerUzi(PLAYER* pp)
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
auto oclipdist = plActor->clipdist;
plActor->clipdist = 0;
@ -15011,7 +15011,7 @@ int InitTracerUzi(PLAYER* pp)
plActor->clipdist = oclipdist;
WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false);
WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false);
// a bit of randomness
actorNew->spr.Angles.Yaw += mapangle(RandomRange(30) - 15);
@ -15224,7 +15224,7 @@ bool HitscanSpriteAdjust(DSWActor* actor, walltype* hit_wall)
int InitUzi(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
HitInfo hit{};
ESpriteFlags cstat = 0;
uint8_t pal = 0;
@ -15260,24 +15260,24 @@ int InitUzi(PLAYER* pp)
if (RANDOM_P2(1024) < 400)
InitTracerUzi(pp);
double nz = (pp->actor->getOffsetZ() + pp->bob_z);
double nz = (pp->GetActor()->getOffsetZ() + pp->bob_z);
double dax = 1024.;
double daz = nz;
DAngle daang = DAngle22_5 / 4;
if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) != nullptr)
if (WeaponAutoAimHitscan(pp->GetActor(), &daz, &daang, false) != nullptr)
{
daang += mapangle(RandomRange(24) - 12);
daz += RandomRangeF(10000/256.) - 5000/256.;
}
else
{
daang = pp->actor->spr.Angles.Yaw + mapangle(RandomRange(24) - 12);
daang = pp->GetActor()->spr.Angles.Yaw + mapangle(RandomRange(24) - 12);
setFreeAimVelocity(dax, daz, pp->Angles.getPitchWithView(), 1000. - (RandomRangeF(24000/256.) - 12000/256.));
}
DVector3 vect(daang.ToVector() * dax, daz);
FAFhitscan(DVector3(pp->actor->spr.pos.XY(), nz), pp->cursector, vect, hit, CLIPMASK_MISSILE);
FAFhitscan(DVector3(pp->GetActor()->spr.pos.XY(), nz), pp->cursector, vect, hit, CLIPMASK_MISSILE);
if (hit.hitSector == nullptr)
{
@ -15374,7 +15374,7 @@ int InitUzi(PLAYER* pp)
return 0;
}
if (BulletHitSprite(pp->actor, hitActor, hit.hitpos, 0))
if (BulletHitSprite(pp->GetActor(), hitActor, hit.hitpos, 0))
return 0;
// hit a switch?
@ -15388,7 +15388,7 @@ int InitUzi(PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos, daang, 0);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(UZI_SMOKE_REPEAT, UZI_SMOKE_REPEAT);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.cstat |= (cstat | CSTAT_SPRITE_YCENTER);
actorNew->clipdist = 0.5;
@ -15399,7 +15399,7 @@ int InitUzi(PLAYER* pp)
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(UZI_SPARK_REPEAT, UZI_SPARK_REPEAT);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->user.spal = actorNew->spr.pal = pal;
actorNew->spr.cstat |= (cstat | CSTAT_SPRITE_YCENTER);
actorNew->clipdist = 0.5;
@ -15430,7 +15430,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_TankShell, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, TANK_SHELL_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.125, 0.125);
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
@ -15468,7 +15468,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp)
int InitTurretMicro(DSWActor* actor, PLAYER* pp)
{
DSWActor* plActor = pp->actor;
DSWActor* plActor = pp->GetActor();
TARGET_SORT* ts = TargetSort;
DSWActor* picked = nullptr;
DAngle angle;
@ -15568,7 +15568,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, ROCKET_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.625, 0.625);
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
@ -15607,7 +15607,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, FIREBALL_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.625, 0.625);
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
@ -15654,7 +15654,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector, actor->spr.pos, actor->spr.Angles.Yaw, 75);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.8125, 0.8125);
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, actorNew->vel.Z, pp->Angles.getPitchWithView(), HORIZ_MULTF);
@ -15671,7 +15671,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp)
actorNew->clipdist = 4;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) == -1)
{
actorNew->norm_ang();
}
@ -15699,7 +15699,7 @@ int InitTurretLaser(DSWActor* actor, PLAYER* pp)
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector, actor->spr.pos, actor->spr.Angles.Yaw, 18.75);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.8125, 0.8125);
actorNew->spr.shade = -15;
@ -15743,7 +15743,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
double daz = npos.Z;
if (RANDOM_P2(1024) < 200)
InitTracerTurret(actor, pp->actor, pp->Angles.getPitchWithView());
InitTracerTurret(actor, pp->GetActor(), pp->Angles.getPitchWithView());
DAngle daang = DAngle22_5 / 2;
if (WeaponAutoAimHitscan(actor, &daz, &daang, false) != nullptr)
@ -15804,7 +15804,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
return 0;
}
if (BulletHitSprite(pp->actor, hit.actor(), hit.hitpos, 0))
if (BulletHitSprite(pp->GetActor(), hit.actor(), hit.hitpos, 0))
return 0;
// hit a switch?
@ -15857,7 +15857,7 @@ int InitSobjGun(PLAYER* pp)
case 32:
case 0:
SpawnVis(actor, nullptr, {}, 8);
SpawnBigGunFlames(actor, pp->actor, pp->sop, false);
SpawnBigGunFlames(actor, pp->GetActor(), pp->sop, false);
SetGunQuake(actor);
InitTankShell(actor, pp);
if (!SP_TAG5(actor))
@ -15867,7 +15867,7 @@ int InitSobjGun(PLAYER* pp)
break;
case 1:
SpawnVis(actor, nullptr, {}, 32);
SpawnBigGunFlames(actor, pp->actor, pp->sop, true);
SpawnBigGunFlames(actor, pp->GetActor(), pp->sop, true);
InitSobjMachineGun(actor, pp);
if (!SP_TAG5(actor))
pp->FirePause = 10;
@ -15937,7 +15937,7 @@ DSWActor* SpawnBoatSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall,
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit_sect, hitpos, hit_ang, 0);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(UZI_SMOKE_REPEAT + 0.1875, UZI_SMOKE_REPEAT + 0.1875);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
@ -15952,7 +15952,7 @@ DSWActor* SpawnBoatSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall,
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(UZI_SPARK_REPEAT + 0.15626, UZI_SPARK_REPEAT + 0.15625);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -15974,12 +15974,12 @@ DSWActor* SpawnBoatSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall,
int SpawnSwordSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, const DVector3& hitpos, DAngle hit_ang)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit_sect, hitpos, hit_ang, 0);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(0.3125, 0.3125);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
@ -15994,7 +15994,7 @@ int SpawnSwordSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, const
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit_sect, hitpos, hit_ang, 0);
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(0.3125, 0.3125);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
if (actor->user.WeaponNum == WPN_FIST)
@ -16058,7 +16058,7 @@ DSWActor* SpawnShotgunSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wal
actorNew->spr.shade = -40;
actorNew->spr.scale = DVector2(UZI_SPARK_REPEAT, UZI_SPARK_REPEAT);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -16068,7 +16068,7 @@ DSWActor* SpawnShotgunSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wal
actorNew = SpawnActor(STAT_MISSILE, SHOTGUN_SMOKE, s_ShotgunSmoke, hit_sect, hitpos, hit_ang, 0);
actorNew->spr.scale = DVector2(SHOTGUN_SMOKE_REPEAT, SHOTGUN_SMOKE_REPEAT);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
@ -16393,7 +16393,7 @@ int InitEnemyUzi(DSWActor* actor)
int InitGrenade(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
double zvel;
bool auto_aim = false;
@ -16409,12 +16409,12 @@ int InitGrenade(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], pp->cursector, pos, pp->actor->spr.Angles.Yaw, GRENADE_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, GRENADE_VELOCITY);
// don't throw it as far if crawling
if (pp->Flags & (PF_CRAWLING))
@ -16426,7 +16426,7 @@ int InitGrenade(PLAYER* pp)
NewStateGroup(actorNew, &sg_Grenade[0]);
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.5, 0.5);
actorNew->spr.shade = -15;
//actorNew->clipdist = 5;
@ -16459,7 +16459,7 @@ int InitGrenade(PLAYER* pp)
actor->clipdist = oclipdist;
zvel = actorNew->vel.Z;
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) >= 0)
if (WeaponAutoAim(pp->GetActor(), actorNew, DAngle22_5 / 4, false) >= 0)
{
auto_aim = true;
}
@ -16538,7 +16538,7 @@ int InitSpriteGrenade(DSWActor* actor)
int InitMine(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
PlayerUpdateAmmo(pp, actor->user.WeaponNum, -1);
@ -16547,14 +16547,14 @@ int InitMine(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 8);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector, pos, pp->actor->spr.Angles.Yaw, MINE_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, MINE_VELOCITY);
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.scale = DVector2(0.5, 0.5);
actorNew->spr.shade = -15;
actorNew->clipdist = 8;
@ -16575,7 +16575,7 @@ int InitMine(PLAYER* pp)
UpdateChange(actorNew, 0.5);
double dot = pp->vect.dot(pp->actor->spr.Angles.Yaw.ToVector());
double dot = pp->vect.dot(pp->GetActor()->spr.Angles.Yaw.ToVector());
// don't adjust for strafing
// not really sure what to do here as the original formula was very likely to overflow, creating a Q0.32 value.
@ -16666,7 +16666,7 @@ int HelpMissileLateral(DSWActor* actor, int dist)
int InitFireball(PLAYER* pp)
{
DSWActor* actor = pp->actor;
DSWActor* actor = pp->GetActor();
PlayerUpdateAmmo(pp, WPN_HOTHEAD, -1);
@ -16678,15 +16678,15 @@ int InitFireball(PLAYER* pp)
if (!pp->insector())
return 0;
auto pos = pp->actor->getPosWithOffsetZ().plusZ(pp->bob_z + 15);
auto pos = pp->GetActor()->getPosWithOffsetZ().plusZ(pp->bob_z + 15);
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Fireball, pp->cursector, pos, pp->actor->spr.Angles.Yaw, FIREBALL_VELOCITY);
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Fireball, pp->cursector, pos, pp->GetActor()->spr.Angles.Yaw, FIREBALL_VELOCITY);
actorNew->spr.hitag = LUMINOUS; //Always full brightness
actorNew->spr.scale = DVector2(0.625, 0.625);
actorNew->spr.shade = -40;
actorNew->clipdist = 2;
SetOwner(pp->actor, actorNew);
SetOwner(pp->GetActor(), actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.Radius = 100;
@ -16717,7 +16717,7 @@ int InitFireball(PLAYER* pp)
actor->clipdist = oclipdist;
actorNew->vel.Z = 0.5;
if (WeaponAutoAimZvel(pp->actor, actorNew, &zvel, DAngle22_5 / 4, false) == -1)
if (WeaponAutoAimZvel(pp->GetActor(), actorNew, &zvel, DAngle22_5 / 4, false) == -1)
{
actorNew->spr.Angles.Yaw -= mapangle(9);
}
@ -17979,7 +17979,7 @@ int DoFloorBlood(DSWActor* actor)
{
pp = &Player[pnum];
double dist = (actor->spr.pos.XY() - pp->actor->spr.pos.XY()).Length();
double dist = (actor->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Length();
if (dist < FEET_IN_BLOOD_DIST)
{

View file

@ -40,7 +40,7 @@ inline DAngle AngToSprite(DSWActor* actor, DSWActor* other)
inline DAngle AngToPlayer(PLAYER* player, DSWActor* other)
{
return (player->actor->getPosWithOffsetZ() - other->spr.pos).Angle();
return (player->GetActor()->getPosWithOffsetZ() - other->spr.pos).Angle();
}

View file

@ -778,7 +778,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->actor->getPosWithOffsetZ(), pp->actor->spr.Angles.Yaw, 0);
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector, pp->GetActor()->getPosWithOffsetZ(), pp->GetActor()->spr.Angles.Yaw, 0);
SetOwner(actorNew, ownerActor);
actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal;
actorNew->spr.Angles.Yaw = RandomAngle();