mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 15:11:04 +00:00
- Duke: Clean up player/actor accesses in checkhitdefault()
.
This commit is contained in:
parent
07466f6080
commit
2fb1dea9e0
1 changed files with 8 additions and 6 deletions
|
@ -1476,13 +1476,15 @@ void checkhitdefault(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
if (targ->spr.statnum == STAT_PLAYER)
|
||||
{
|
||||
auto p = targ->PlayerIndex();
|
||||
if (getPlayer(p)->newOwner != nullptr)
|
||||
{
|
||||
getPlayer(p)->newOwner = nullptr;
|
||||
getPlayer(p)->GetActor()->restoreloc();
|
||||
const auto p = getPlayer(targ->PlayerIndex());
|
||||
const auto pact = p->GetActor();
|
||||
|
||||
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);
|
||||
while (auto itActor = it.Next())
|
||||
|
|
Loading…
Reference in a new issue