Prevent orbit from being freed by using P_SetTarget in K_RepairOrbitChain

This commit is contained in:
indev committed 2026-09-25 21:54:49 +03:00
1 parent 91f016fd0c
commit 13241d1880
1 file changed
+6
+6
View File
@@ -4706,6 +4706,10 @@ void K_DropKitchenSink(player_t *player)
// When an item in the hnext chain dies.
void K_RepairOrbitChain(mobj_t *orbit)
{
// Prevent orbit from being freed
mobj_t *dummy = NULL;
P_SetTarget(&dummy, orbit);
mobj_t *cachenext = orbit->hnext;
// First, repair the chain
@@ -4742,6 +4746,8 @@ void K_RepairOrbitChain(mobj_t *orbit)
if (!P_MobjWasRemovedCompat(orbit->target))
orbit->target->player->kartstuff[k_itemamount] = num;
}
P_SetTarget(&dummy, NULL);
}
// Simplified version of a code bit in P_MobjFloorZ