(svn r23480) -Fix [FS#4594]: replace OS error messages with internal error messages when that's possible

This commit is contained in:
rubidium
2011-12-10 16:05:26 +00:00
parent c7d2c294fc
commit c3440658e8
4 changed files with 53 additions and 17 deletions

View File

@@ -2285,7 +2285,8 @@ static const SaveLoadFormat *GetSavegameFormat(char *s, byte *compression_level)
char *end;
long level = strtol(complevel, &end, 10);
if (end == complevel || level != Clamp(level, slf->min_compression, slf->max_compression)) {
ShowInfoF("Compression level '%s' is not valid.", complevel);
SetDParamStr(0, complevel);
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL, WL_CRITICAL);
} else {
*compression_level = level;
}
@@ -2294,7 +2295,9 @@ static const SaveLoadFormat *GetSavegameFormat(char *s, byte *compression_level)
}
}
ShowInfoF("Savegame format '%s' is not available. Reverting to '%s'.", s, def->name);
SetDParamStr(0, s);
SetDParamStr(1, def->name);
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_ALGORITHM, WL_CRITICAL);
/* Restore the string by adding the : back */
if (complevel != NULL) *complevel = ':';