diff --git a/src/dehacked.c b/src/dehacked.c index 958eaad32..79d0b46dd 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -594,21 +594,21 @@ static void readfreeslots(MYFILE *f) else if (fastcmp(type, "TOL")) { // Search if we already have a typeoflevel by that name... - for (i = 0; i < numtolinfo; i++) + for (i = 0; TYPEOFLEVEL[i].name; i++) if (fastcmp(word, TYPEOFLEVEL[i].name)) break; // We found it? Then don't allocate another one. - if (i < numtolinfo) + if (TYPEOFLEVEL[i].name) continue; // We don't, so freeslot it. - if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. deh_warning("Ran out of free typeoflevel slots!\n"); else { - G_AddTOL((1<= numtolinfo) { - if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + if (TYPEOFLEVEL[i].name == NULL) { + if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); else { - UINT32 newtol = (1<