mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 23:31:50 +00:00
Bail out of P_RespawnSpecials if no mobjinfo entry has a doomednum that matches, and print a warning to the console.
This prevents a mobj of NUMMOBJTYPES from being created and potentially crashing the game. Really, this happens only if you start messing with the mapthings of respawning items like rings/weapons/etc in the first place via Lua.
This commit is contained in:
parent
baf227175b
commit
ec10367856
1 changed files with 10 additions and 0 deletions
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -8332,6 +8332,16 @@ void P_RespawnSpecials(void)
|
|||
if (mthing->type == mobjinfo[i].doomednum)
|
||||
break;
|
||||
|
||||
if (i == NUMMOBJTYPES) // prevent creation of objects with this type -- Monster Iestyn 17/12/17
|
||||
{
|
||||
// 3D Mode start Thing is unlikely to be added to the que,
|
||||
// so don't bother checking for that specific type
|
||||
CONS_Alert(CONS_WARNING, M_GetText("P_RespawnSpecials: Unknown thing type %d attempted to respawn at (%d, %d)\n"), mthing->type, mthing->x, mthing->y);
|
||||
// pull it from the que
|
||||
iquetail = (iquetail+1)&(ITEMQUESIZE-1);
|
||||
return;
|
||||
}
|
||||
|
||||
//CTF rings should continue to respawn as normal rings outside of CTF.
|
||||
if (gametype != GT_CTF)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue