- Duke: Clean up player/actor accesses in handle_se26().

This commit is contained in:
Mitchell Richters 2023-10-02 20:42:42 +11:00
parent 6764acccb0
commit c98083bf75

View file

@ -3249,13 +3249,18 @@ void handle_se26(DDukeActor* actor)
}
}
for (int p = connecthead; p >= 0; p = connectpoint2[p])
if (getPlayer(p)->GetActor()->sector() == actor->sector() && getPlayer(p)->on_ground)
for (int i = connecthead; i >= 0; i = connectpoint2[i])
{
const auto p = getPlayer(i);
const auto pact = p->GetActor();
if (pact->sector() == actor->sector() && p->on_ground)
{
getPlayer(p)->fric.X += vect.X;
getPlayer(p)->fric.Y += vect.Y;
getPlayer(p)->GetActor()->spr.pos.Z += zvel;
p->fric.X += vect.X;
p->fric.Y += vect.Y;
pact->spr.pos.Z += zvel;
}
}
movesector(actor, actor->temp_data[1], nullAngle);
//SetActor(actor, actor->spr.pos);