Limits checking
This commit is contained in:
parent
74d69f3731
commit
eadb3dec9e
|
@ -594,8 +594,13 @@ static void readfreeslots(MYFILE *f)
|
||||||
}
|
}
|
||||||
else if (fastcmp(type, "TOL"))
|
else if (fastcmp(type, "TOL"))
|
||||||
{
|
{
|
||||||
G_AddTOL(lastcustomtol, word);
|
if (lastcustomtol > 31)
|
||||||
lastcustomtol <<= 1;
|
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
G_AddTOL((1<<lastcustomtol), word);
|
||||||
|
lastcustomtol++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
deh_warning("Freeslots: unknown enum class '%s' for '%s_%s'", type, type, word);
|
deh_warning("Freeslots: unknown enum class '%s' for '%s_%s'", type, type, word);
|
||||||
|
@ -1103,7 +1108,7 @@ static void readsprite2(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 numtolinfo = NUMBASETOL;
|
INT32 numtolinfo = NUMBASETOL;
|
||||||
UINT32 lastcustomtol = (TOL_XMAS << 1);
|
UINT32 lastcustomtol = 13;
|
||||||
|
|
||||||
tolinfo_t TYPEOFLEVEL[NUMMAXTOL] = {
|
tolinfo_t TYPEOFLEVEL[NUMMAXTOL] = {
|
||||||
{"SOLO",TOL_SP},
|
{"SOLO",TOL_SP},
|
||||||
|
@ -1288,6 +1293,13 @@ static void readgametype(MYFILE *f, char *gtname)
|
||||||
if (word2lwr)
|
if (word2lwr)
|
||||||
Z_Free(word2lwr);
|
Z_Free(word2lwr);
|
||||||
|
|
||||||
|
// Ran out of gametype slots
|
||||||
|
if (gametypecount == NUMGAMETYPEFREESLOTS)
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_WARNING, "Ran out of free gametype slots!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the new gametype
|
// Add the new gametype
|
||||||
newgtidx = G_AddGametype(newgtrules);
|
newgtidx = G_AddGametype(newgtrules);
|
||||||
G_AddGametypeTOL(newgtidx, newgttol);
|
G_AddGametypeTOL(newgtidx, newgttol);
|
||||||
|
|
Loading…
Reference in New Issue