mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- Duke: Clean up player/actor accesses in footprints()
.
This commit is contained in:
parent
d44d14a770
commit
4865fc7d8e
4 changed files with 7 additions and 8 deletions
|
@ -101,7 +101,7 @@ int timedexit(int snum);
|
|||
void dokneeattack(DDukePlayer* const p);
|
||||
int endoflevel(int snum);
|
||||
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);
|
||||
void playerCrouch(int snum);
|
||||
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();
|
||||
|
||||
if (p->footprintcount > 0 && p->on_ground)
|
||||
|
@ -497,8 +496,8 @@ void footprints(int snum)
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->IsKindOf(DukeFootprintsClass))
|
||||
if (abs(act->spr.pos.X - p->GetActor()->spr.pos.X) < 24)
|
||||
if (abs(act->spr.pos.Y - p->GetActor()->spr.pos.Y) < 24)
|
||||
if (abs(act->spr.pos.X - actor->spr.pos.X) < 24)
|
||||
if (abs(act->spr.pos.Y - actor->spr.pos.Y) < 24)
|
||||
{
|
||||
j = 1;
|
||||
break;
|
||||
|
@ -512,7 +511,7 @@ void footprints(int snum)
|
|||
DDukeActor* fprint = spawn(actor, DukeFootprintsClass);
|
||||
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.shade = (int8_t)p->footprintshade;
|
||||
}
|
||||
|
|
|
@ -683,7 +683,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
}
|
||||
else
|
||||
{
|
||||
footprints(snum);
|
||||
footprints(p);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
footprints(snum);
|
||||
footprints(p);
|
||||
}
|
||||
|
||||
if (pact->getOffsetZ() < floorz - i) //falling
|
||||
|
|
Loading…
Reference in a new issue