+static void checkSeriesInfo()
+{
+ static char *level_directory = NULL;
+ DIR *dir;
+ struct dirent *dir_entry;
+
+ /* check for more levels besides the 'levels' field of 'levelinfo.conf' */
+
+ level_directory = getPath2((leveldir_current->user_defined ?
+ getUserLevelDir("") :
+ options.level_directory),
+ leveldir_current->fullpath);
+
+ if ((dir = opendir(level_directory)) == NULL)
+ {
+ Error(ERR_WARN, "cannot read level directory '%s'", level_directory);
+ return;
+ }
+
+ while ((dir_entry = readdir(dir)) != NULL) /* last directory entry */
+ {
+ if (strlen(dir_entry->d_name) > 4 &&
+ dir_entry->d_name[3] == '.' &&
+ strcmp(&dir_entry->d_name[4], LEVELFILE_EXTENSION) == 0)
+ {
+ char levelnum_str[4];
+ int levelnum_value;
+
+ strncpy(levelnum_str, dir_entry->d_name, 3);
+ levelnum_str[3] = '\0';
+
+ levelnum_value = atoi(levelnum_str);
+
+ if (levelnum_value < leveldir_current->first_level)
+ {
+ Error(ERR_WARN, "additional level %d found", levelnum_value);
+ leveldir_current->first_level = levelnum_value;
+ }
+ else if (levelnum_value > leveldir_current->last_level)
+ {
+ Error(ERR_WARN, "additional level %d found", levelnum_value);
+ leveldir_current->last_level = levelnum_value;
+ }
+ }
+ }
+
+ closedir(dir);
+}
+
+void LoadLevelSetup_SeriesInfo()