mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-03 06:20:56 +00:00
- Duke: Clean up player/actor accesses in alterang()
.
This commit is contained in:
parent
5e82e5ab94
commit
6f248ff34c
1 changed files with 5 additions and 3 deletions
|
@ -4008,6 +4008,8 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
int j;
|
||||
int ticselapsed;
|
||||
|
||||
const auto p = getPlayer(playernum);
|
||||
const auto pact = p->GetActor();
|
||||
auto moveptr = &ScriptCode[actor->temp_data[1]];
|
||||
|
||||
ticselapsed = (actor->counter) & 31;
|
||||
|
@ -4024,13 +4026,13 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
actor->spr.Angles.Yaw = WindDir;
|
||||
else if (ang & seekplayer)
|
||||
{
|
||||
DDukeActor* holoduke = !isRR()? getPlayer(playernum)->holoduke_on.Get() : nullptr;
|
||||
DDukeActor* holoduke = !isRR()? p->holoduke_on.Get() : nullptr;
|
||||
|
||||
// NOTE: looks like 'Owner' is set to target sprite ID...
|
||||
|
||||
if (holoduke && cansee(holoduke->spr.pos, holoduke->sector(), actor->spr.pos, actor->sector()))
|
||||
actor->SetOwner(holoduke);
|
||||
else actor->SetOwner(getPlayer(playernum)->GetActor());
|
||||
else actor->SetOwner(pact);
|
||||
|
||||
auto Owner = actor->GetOwner();
|
||||
if (Owner->isPlayer())
|
||||
|
@ -4068,7 +4070,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
{
|
||||
goalang = furthestangle(actor, j);
|
||||
actor->spr.Angles.Yaw = goalang;
|
||||
actor->SetOwner(getPlayer(playernum)->GetActor());
|
||||
actor->SetOwner(pact);
|
||||
}
|
||||
|
||||
if (ang & fleeenemy)
|
||||
|
|
Loading…
Reference in a new issue