mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 12:32:13 +00:00
- Duke: Clean up player/actor accesses in footprints()
.
This commit is contained in:
parent
079df4dd8f
commit
7186c3e9f7
4 changed files with 7 additions and 8 deletions
|
@ -101,7 +101,7 @@ int timedexit(int snum);
|
||||||
void dokneeattack(DDukePlayer* const p);
|
void dokneeattack(DDukePlayer* const p);
|
||||||
int endoflevel(int snum);
|
int endoflevel(int snum);
|
||||||
void playerisdead(int snum, int psectlotag, double fz, double cz);
|
void playerisdead(int snum, int psectlotag, double fz, double cz);
|
||||||
void footprints(int snum);
|
void footprints(DDukePlayer* const p);
|
||||||
int makepainsounds(DDukePlayer* const p, int type);
|
int makepainsounds(DDukePlayer* const p, int type);
|
||||||
void playerCrouch(int snum);
|
void playerCrouch(int snum);
|
||||||
void playerJump(int snum, double fz, double cz);
|
void playerJump(int snum, double fz, double cz);
|
||||||
|
|
|
@ -484,9 +484,8 @@ int makepainsounds(DDukePlayer* const p, int type)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void footprints(int snum)
|
void footprints(DDukePlayer* const p)
|
||||||
{
|
{
|
||||||
auto p = getPlayer(snum);
|
|
||||||
auto actor = p->GetActor();
|
auto actor = p->GetActor();
|
||||||
|
|
||||||
if (p->footprintcount > 0 && p->on_ground)
|
if (p->footprintcount > 0 && p->on_ground)
|
||||||
|
@ -497,8 +496,8 @@ void footprints(int snum)
|
||||||
while (auto act = it.Next())
|
while (auto act = it.Next())
|
||||||
{
|
{
|
||||||
if (act->IsKindOf(DukeFootprintsClass))
|
if (act->IsKindOf(DukeFootprintsClass))
|
||||||
if (abs(act->spr.pos.X - p->GetActor()->spr.pos.X) < 24)
|
if (abs(act->spr.pos.X - actor->spr.pos.X) < 24)
|
||||||
if (abs(act->spr.pos.Y - p->GetActor()->spr.pos.Y) < 24)
|
if (abs(act->spr.pos.Y - actor->spr.pos.Y) < 24)
|
||||||
{
|
{
|
||||||
j = 1;
|
j = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -512,7 +511,7 @@ void footprints(int snum)
|
||||||
DDukeActor* fprint = spawn(actor, DukeFootprintsClass);
|
DDukeActor* fprint = spawn(actor, DukeFootprintsClass);
|
||||||
if (fprint)
|
if (fprint)
|
||||||
{
|
{
|
||||||
fprint->spr.Angles.Yaw = p->GetActor()->spr.Angles.Yaw;
|
fprint->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||||
fprint->spr.pal = p->footprintpal;
|
fprint->spr.pal = p->footprintpal;
|
||||||
fprint->spr.shade = (int8_t)p->footprintshade;
|
fprint->spr.shade = (int8_t)p->footprintshade;
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,7 +683,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
footprints(snum);
|
footprints(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pact->getOffsetZ() < floorz - i) //falling
|
if (pact->getOffsetZ() < floorz - i) //falling
|
||||||
|
|
|
@ -1163,7 +1163,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
||||||
}
|
}
|
||||||
else if (!p->OnMotorcycle)
|
else if (!p->OnMotorcycle)
|
||||||
{
|
{
|
||||||
footprints(snum);
|
footprints(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pact->getOffsetZ() < floorz - i) //falling
|
if (pact->getOffsetZ() < floorz - i) //falling
|
||||||
|
|
Loading…
Reference in a new issue