mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-03 07:21:00 +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)
|
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())
|
||||||
|
|
Loading…
Reference in a new issue