mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +00:00
- Duke: Clean up player/actor accesses in shoot()
.
This commit is contained in:
parent
8b62cf63fb
commit
31a43cdd79
1 changed files with 7 additions and 7 deletions
|
@ -927,7 +927,7 @@ void playerAimDown(DDukePlayer* const p, ESyncBits actions)
|
||||||
|
|
||||||
void shoot(DDukeActor* actor, PClass* cls)
|
void shoot(DDukeActor* actor, PClass* cls)
|
||||||
{
|
{
|
||||||
int p;
|
int pnum;
|
||||||
DVector3 spos;
|
DVector3 spos;
|
||||||
DAngle sang;
|
DAngle sang;
|
||||||
|
|
||||||
|
@ -936,14 +936,14 @@ void shoot(DDukeActor* actor, PClass* cls)
|
||||||
sang = actor->spr.Angles.Yaw;
|
sang = actor->spr.Angles.Yaw;
|
||||||
if (actor->isPlayer())
|
if (actor->isPlayer())
|
||||||
{
|
{
|
||||||
p = actor->PlayerIndex();
|
pnum = actor->PlayerIndex();
|
||||||
spos = actor->getPosWithOffsetZ().plusZ(getPlayer(p)->pyoff + 4);
|
const auto p = getPlayer(pnum);
|
||||||
|
spos = actor->getPosWithOffsetZ().plusZ(p->pyoff + 4);
|
||||||
getPlayer(p)->crack_time = CRACK_TIME;
|
p->crack_time = CRACK_TIME;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p = -1;
|
pnum = -1;
|
||||||
auto tex = TexMan.GetGameTexture(actor->spr.spritetexture());
|
auto tex = TexMan.GetGameTexture(actor->spr.spritetexture());
|
||||||
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tex->GetDisplayHeight() * 0.5) + 4);
|
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tex->GetDisplayHeight() * 0.5) + 4);
|
||||||
|
|
||||||
|
@ -958,7 +958,7 @@ void shoot(DDukeActor* actor, PClass* cls)
|
||||||
if (cls == nullptr)
|
if (cls == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CallShootThis(static_cast<DDukeActor*>(GetDefaultByType(cls)), actor, p, spos, sang);
|
CallShootThis(static_cast<DDukeActor*>(GetDefaultByType(cls)), actor, pnum, spos, sang);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue