X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=de23a94035ee2ef5da704d97a06e53ec43f21b8a;hb=2fab4d4c183c2ac47cef52a09b45ed6a83ad31cb;hp=bf02c2276e2a6a2f2227e993705fa64d26ad15f3;hpb=3e10387c490e2db8997d6e909d7d13d71fe876e3;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index bf02c227..de23a940 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -31,6 +31,7 @@ #define ENABLE_UNUSED_CODE FALSE /* for currently unused functions */ +#define DEBUG_NO_CONFIG_FILE FALSE /* for extra-verbose debug output */ #define NUM_LEVELCLASS_DESC 8 @@ -2024,7 +2025,9 @@ static boolean loadSetupFileData(void *setup_file_data, char *filename, if (!(file = openFile(filename, MODE_READ))) { +#if DEBUG_NO_CONFIG_FILE Error(ERR_DEBUG, "cannot open configuration file '%s'", filename); +#endif return FALSE; } @@ -2629,6 +2632,10 @@ void setSetupInfo(struct TokenInfo *token_info, *(char **)setup_value = getStringCopy(token_value); break; + case TYPE_PLAYER: + *(int *)setup_value = get_player_nr_from_string(token_value); + break; + default: break; } @@ -2962,7 +2969,9 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first, if (setup_file_hash == NULL) { +#if DEBUG_NO_CONFIG_FILE Error(ERR_WARN, "ignoring level directory '%s'", directory_path); +#endif free(directory_path); free(filename); @@ -3200,8 +3209,10 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first, if (!valid_file_found) { +#if DEBUG_NO_CONFIG_FILE if (!strEqual(directory_name, ".")) Error(ERR_WARN, "ignoring artwork directory '%s'", directory_path); +#endif free(directory_path); free(filename); @@ -3872,6 +3883,10 @@ char *getSetupValue(int type, void *value) strcpy(value_string, *(char **)value); break; + case TYPE_PLAYER: + sprintf(value_string, "player_%d", *(int *)value + 1); + break; + default: value_string[0] = '\0'; break;