mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Spawn MT_RAY when attempting to spawn MT_NULL
Some code assumes that P_SpawnMobj can never return NULL So spawn MT_RAY in it's place when attempting to spawn MT_NULL and show a console warning (cherry picked from commit 34f8464cbfc01adf1650da1311a0751fce5b0678)
This commit is contained in:
parent
3a2fe22485
commit
c73d3b4244
1 changed files with 7 additions and 0 deletions
|
|
@ -9880,10 +9880,17 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
|
|
||||||
if (type == MT_NULL)
|
if (type == MT_NULL)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
I_Error("Tried to spawn MT_NULL\n");
|
I_Error("Tried to spawn MT_NULL\n");
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
// Hack: Some code assumes that P_SpawnMobj can never return NULL
|
||||||
|
// So replace MT_NULL with MT_RAY in the meantime
|
||||||
|
// Remove when dealt properly
|
||||||
|
CONS_Alert(CONS_WARNING, "Tried to spawn MT_NULL, using MT_RAY\n");
|
||||||
|
type = MT_RAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue