Monkey-patch likely cause of Eggshrine crash

This commit is contained in:
toaster 2025-09-11 20:49:48 +01:00
parent 05c475052d
commit 35c7be3bb9

View file

@ -1237,13 +1237,14 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
} }
// If you CAN recieve points, get them! // If you CAN recieve points, get them!
if ((gametyperules & GTR_POINTLIMIT) && (source && source->player)) if ((gametyperules & GTR_POINTLIMIT)
&& (source && !P_MobjWasRemoved(source) && source->player))
{ {
K_GivePointsToPlayer(source->player, NULL, 1); K_GivePointsToPlayer(source->player, NULL, 1);
} }
targetdamaging_t targetdamaging = UFOD_GENERIC; targetdamaging_t targetdamaging = UFOD_GENERIC;
if (P_MobjWasRemoved(inflictor) == true) if (!inflictor || P_MobjWasRemoved(inflictor) == true)
; ;
else switch (inflictor->type) else switch (inflictor->type)
{ {
@ -1342,6 +1343,10 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
secretextratime = TICRATE/2; secretextratime = TICRATE/2;
} }
// Everything below dependent on our coords
if (!target || P_MobjWasRemoved(target))
return;
// Prison Egg challenge drops (CDs, etc) // Prison Egg challenge drops (CDs, etc)
#ifdef DEVELOP #ifdef DEVELOP
extern consvar_t cv_debugprisoncd; extern consvar_t cv_debugprisoncd;