Never spawn MT_NULL

(cherry picked from commit a8c658b545e3c7709212a43489163f33ffbe91f0)
This commit is contained in:
James R 2022-02-01 04:04:53 -08:00
parent 72342338b1
commit 707f487f92

View file

@ -9876,7 +9876,17 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
const mobjinfo_t *info = &mobjinfo[type];
SINT8 sc = -1;
state_t *st;
mobj_t *mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
mobj_t *mobj;
if (type == MT_NULL)
{
#ifdef PARANOIA
I_Error("Tried to spawn MT_NULL\n");
#endif
return NULL;
}
mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
// this is officially a mobj, declared as soon as possible.
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;