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

This commit is contained in:
Mitchell Richters 2023-10-04 11:17:56 +11:00 committed by Christoph Oelckers
parent 5f132f5cda
commit 4b410d48ba

View file

@ -408,14 +408,17 @@ void doanimations(void)
if (type == anim_floorz) if (type == anim_floorz)
{ {
for (auto p = connecthead; p >= 0; p = connectpoint2[p]) for (auto j = connecthead; j >= 0; j = connectpoint2[j])
if (getPlayer(p)->cursector == dasectp) {
if ((dasectp->floorz - getPlayer(p)->GetActor()->getOffsetZ()) < 64) const auto p = getPlayer(j);
if (getPlayer(p)->GetActor()->GetOwner() != nullptr) const auto pact = p->GetActor();
{
getPlayer(p)->GetActor()->spr.pos.Z += v; if ((p->cursector == dasectp) && ((dasectp->floorz - pact->getOffsetZ()) < 64) && (pact->GetOwner() != nullptr))
getPlayer(p)->vel.Z = 0; {
} pact->spr.pos.Z += v;
p->vel.Z = 0;
}
}
DukeSectIterator it(dasectp); DukeSectIterator it(dasectp);
while (auto act = it.Next()) while (auto act = it.Next())