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

This commit is contained in:
Mitchell Richters 2023-10-02 20:37:18 +11:00
parent 892eb16d8b
commit 77eb44fd54

View file

@ -332,9 +332,10 @@ void checkavailweapon(DukePlayer* player)
void clearcamera(DukePlayer* ps)
{
const auto pact = ps->GetActor();
ps->newOwner = nullptr;
ps->GetActor()->restoreloc();
updatesector(ps->GetActor()->getPosWithOffsetZ(), &ps->cursector);
pact->restoreloc();
updatesector(pact->getPosWithOffsetZ(), &ps->cursector);
DukeStatIterator it(STAT_ACTOR);
while (auto k = it.Next())