0
0
Fork 0
mirror of https://github.com/ZDoom/Raze.git synced 2025-03-03 15:31:07 +00:00

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

This commit is contained in:
Mitchell Richters 2023-10-04 11:21:17 +11:00
parent 07466f6080
commit 2fb1dea9e0

View file

@ -1476,13 +1476,15 @@ void checkhitdefault(DDukeActor* targ, DDukeActor* proj)
if (targ->spr.statnum == STAT_PLAYER) if (targ->spr.statnum == STAT_PLAYER)
{ {
auto p = targ->PlayerIndex(); const auto p = getPlayer(targ->PlayerIndex());
if (getPlayer(p)->newOwner != nullptr) const auto pact = p->GetActor();
{
getPlayer(p)->newOwner = nullptr;
getPlayer(p)->GetActor()->restoreloc();
updatesector(getPlayer(p)->GetActor()->getPosWithOffsetZ(), &getPlayer(p)->cursector); if (p->newOwner != nullptr)
{
p->newOwner = nullptr;
pact->restoreloc();
updatesector(pact->getPosWithOffsetZ(), &p->cursector);
DukeStatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
while (auto itActor = it.Next()) while (auto itActor = it.Next())