(svn r3852) - Revert r3733 which fixed the default value loading for char, but broke loading a set value. Added a better fix which needs a char value to be a string (eg enclosed in double-quotes)
authorDarkvater
Mon, 13 Mar 2006 23:10:02 +0000
changeset 3192 5ac5072bf4b6
parent 3191 d273bda0f5d4
child 3193 d151574ef3cf
(svn r3852) - Revert r3733 which fixed the default value loading for char, but broke loading a set value. Added a better fix which needs a char value to be a string (eg enclosed in double-quotes)
settings.c
--- a/settings.c	Mon Mar 13 20:12:35 2006 +0000
+++ b/settings.c	Mon Mar 13 23:10:02 2006 +0000
@@ -643,7 +643,7 @@
 				case SLE_VAR_STRQ:
 					if (p != NULL) ttd_strlcpy((char*)ptr, p, sld->length);
 					break;
-				case SLE_VAR_CHAR: *(char*)ptr = (char)(unsigned long)p; break;
+				case SLE_VAR_CHAR: *(char*)ptr = *(char*)p; break;
 				default: NOT_REACHED(); break;
 			}
 			break;
@@ -1300,7 +1300,7 @@
 
 static const SettingDesc _currency_settings[] = {
 	SDT_VAR(CurrencySpec, rate,    SLE_UINT16, S, 0,  1, 0, 100, STR_NULL, NULL),
-	SDT_CHR(CurrencySpec, separator,           S, 0,        '.', STR_NULL, NULL),
+	SDT_CHR(CurrencySpec, separator,           S, 0,        ".", STR_NULL, NULL),
 	SDT_VAR(CurrencySpec, to_euro, SLE_UINT16, S, 0,  0, 0,1000, STR_NULL, NULL),
 	SDT_STR(CurrencySpec, prefix,    SLE_STRQ, S, 0,       NULL, STR_NULL, NULL),
 	SDT_STR(CurrencySpec, suffix,    SLE_STRQ, S, 0, " credits", STR_NULL, NULL),