+
+ /* try to determine better author name than 'anonymous' */
+ if (strcmp(leveldir[leveldir_nr].author, ANONYMOUS_NAME) != 0)
+ {
+ strncpy(level.author, leveldir[leveldir_nr].author,
+ MAX_LEVEL_AUTHOR_LEN - 1);
+ level.author[MAX_LEVEL_AUTHOR_LEN - 1] = '\0';
+ }
+ else
+ {
+ switch (LEVELCLASS(leveldir_nr))
+ {
+ case LEVELCLASS_TUTORIAL:
+ strcpy(level.author, PROGRAM_AUTHOR_STRING);
+ break;
+
+ case LEVELCLASS_CONTRIBUTION:
+ strncpy(level.author, leveldir[leveldir_nr].name,
+ MAX_LEVEL_AUTHOR_LEN - 1);
+ level.author[MAX_LEVEL_AUTHOR_LEN - 1] = '\0';
+ break;
+
+ case LEVELCLASS_USER:
+ strncpy(level.author, getRealName(), MAX_LEVEL_AUTHOR_LEN - 1);
+ level.author[MAX_LEVEL_AUTHOR_LEN - 1] = '\0';
+ break;
+
+ default:
+ /* keep default value */
+ break;
+ }
+ }