diff options
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c index 52035d3bd..f55a85170 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3292,6 +3292,18 @@ int parse_console(char *buf) { return 0; } +//------------------------------------------------- +// Return numerical value of a switch configuration +// on/off, english, franais, deutsch, espaol +//------------------------------------------------- +int config_switch(const char *str) { + if (strcmpi(str, "on") == 0 || strcmpi(str, "yes") == 0 || strcmpi(str, "oui") == 0 || strcmpi(str, "ja") == 0 || strcmpi(str, "si") == 0) + return 1; + if (strcmpi(str, "off") == 0 || strcmpi(str, "no") == 0 || strcmpi(str, "non") == 0 || strcmpi(str, "nein") == 0) + return 0; + return atoi(str); +} + /*========================================== * ݒt@C?? *------------------------------------------ @@ -3321,6 +3333,8 @@ int map_config_read(char *cfgName) { if(strcmpi(w1,"timestamp_format")==0){ strncpy(timestamp_format, w2, 20); + } else if(strcmpi(w1,"stdout_with_ansisequence")==0){ + stdout_with_ansisequence = config_switch(w2); } else if(strcmpi(w1,"console_silent")==0){ msg_silent = 0; //To always allow the next line to show up. ShowInfo("Console Silent Setting: %d\n", atoi(w2)); |