Add null check into P_SpawnMapThing so game doesn't crash if it fails to spawn mapthing for some reason

This commit is contained in:
indev committed 2023-10-13 01:30:46 +03:00
1 parent 0a0567c311
commit f2f324c487
1 file changed
+6
+6
View File
@@ -11374,6 +11374,12 @@ void P_SpawnMapThing(mapthing_t *mthing)
}
mobj = P_SpawnMobj(x, y, z, i);
if (!mobj || P_MobjWasRemoved(mobj)) {
CONS_Alert(CONS_WARNING, "Failed to spawn map thing #%d at %d, %d\n", mthing->type, x>>FRACBITS, y>>FRACBITS);
return;
}
mobj->spawnpoint = mthing;
switch(mobj->type)