mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
P_RemoveMobj: only repair hnext linked list is object is a part of the list
This indirectly fixes a bug with Rocket Sneakers: - Give yourself Rocket Sneakers, use them up completely. - Instantly give yourself and deploy Orbinauts (may want to use a bind for this, since it has to be quick). - Wait a moment for the exploded Rocket Sneakers to fall to the ground. When this happens, the Orbinauts will stop following the player -- they will enter a buggy state. So many items uses hnext/hprev, that I decided to make a general fix that probably covers most bugs that could arise from poor handling of hnext/hprev.
This commit is contained in:
parent
c8cf6a4621
commit
a392996a54
1 changed files with 10 additions and 2 deletions
|
|
@ -11330,14 +11330,22 @@ void P_RemoveMobj(mobj_t *mobj)
|
|||
mobj_t *cachenext = mobj->hnext;
|
||||
|
||||
if (mobj->hnext && !P_MobjWasRemoved(mobj->hnext))
|
||||
{
|
||||
if (mobj->hnext->hprev == mobj)
|
||||
{
|
||||
P_SetTarget(&mobj->hnext->hprev, mobj->hprev);
|
||||
}
|
||||
|
||||
P_SetTarget(&mobj->hnext, NULL);
|
||||
}
|
||||
|
||||
if (mobj->hprev && !P_MobjWasRemoved(mobj->hprev))
|
||||
{
|
||||
if (mobj->hprev->hnext == mobj)
|
||||
{
|
||||
P_SetTarget(&mobj->hprev->hnext, cachenext);
|
||||
}
|
||||
|
||||
P_SetTarget(&mobj->hprev, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue