src/settings.cpp
branchgamebalance
changeset 9906 6f41b8713b65
parent 9904 e7d15ae60d43
child 9907 3b068c3a1c74
equal deleted inserted replaced
9905:91eca6fdee8d 9906:6f41b8713b65
   583 		if (*end != '\0') ShowInfoF("ini: trailing characters at end of setting '%s'", desc->name);
   583 		if (*end != '\0') ShowInfoF("ini: trailing characters at end of setting '%s'", desc->name);
   584 		return (void*)val;
   584 		return (void*)val;
   585 	}
   585 	}
   586 	case SDT_ONEOFMANY: {
   586 	case SDT_ONEOFMANY: {
   587 		long r = lookup_oneofmany(desc->many, str, -1);
   587 		long r = lookup_oneofmany(desc->many, str, -1);
   588 		if (r != -1) return (void*)r;
   588 		/* if the first attempt of conversion from string to the appropriate value fails,
   589 		ShowInfoF("ini: invalid value '%s' for '%s'", str, desc->name);
   589 		 * look if we have defined a converter from old value to new value. */
       
   590 		if (r == -1 && desc->proc_cnvt != NULL) r = desc->proc_cnvt(str);
       
   591 		if (r != -1) return (void*)r; //and here goes converted value
       
   592 		ShowInfoF("ini: invalid value '%s' for '%s'", str, desc->name); //sorry, we failed
   590 		return 0;
   593 		return 0;
   591 	}
   594 	}
   592 	case SDT_MANYOFMANY: {
   595 	case SDT_MANYOFMANY: {
   593 		unsigned long r = lookup_manyofmany(desc->many, str);
   596 		unsigned long r = lookup_manyofmany(desc->many, str);
   594 		if (r != (unsigned long)-1) return (void*)r;
   597 		if (r != (unsigned long)-1) return (void*)r;
   943  * it has grown in size its length cannot be automatically be calculated so
   946  * it has grown in size its length cannot be automatically be calculated so
   944  * use SDT(G)_CONDLISTO() meaning Old.
   947  * use SDT(G)_CONDLISTO() meaning Old.
   945  * If nothing fits you, you can use the GENERAL macros, but it exposes the
   948  * If nothing fits you, you can use the GENERAL macros, but it exposes the
   946  * internal structure somewhat so it needs a little looking. There are _NULL()
   949  * internal structure somewhat so it needs a little looking. There are _NULL()
   947  * macros as well, these fill up space so you can add more patches there (in
   950  * macros as well, these fill up space so you can add more patches there (in
   948  * place) and you DON'T have to increase the savegame version. */
   951  * place) and you DON'T have to increase the savegame version.
   949 
   952  *
   950 #define NSD_GENERAL(name, def, cmd, guiflags, min, max, interval, many, str, proc)\
   953  * While reading values from openttd.cfg, some values may not be converted
   951 	{name, (const void*)(def), {cmd}, {guiflags}, min, max, interval, many, str, proc}
   954  * properly, for any kind of reasons.  In order to allow a process of self-cleaning
       
   955  * mechanism, a callback procedure is made available.  You will have to supply the function, which
       
   956  * will work on a string, one function per patch.  And of course, enable the callback param
       
   957  * on the appropriate macro.
       
   958  */
       
   959 
       
   960 #define NSD_GENERAL(name, def, cmd, guiflags, min, max, interval, many, str, proc, load)\
       
   961 	{name, (const void*)(def), {cmd}, {guiflags}, min, max, interval, many, str, proc, load}
   952 
   962 
   953 /* Macros for various objects to go in the configuration file.
   963 /* Macros for various objects to go in the configuration file.
   954  * This section is for global variables */
   964  * This section is for global variables */
   955 #define SDTG_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, var, length, def, min, max, interval, full, str, proc, from, to)\
   965 #define SDTG_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, var, length, def, min, max, interval, full, str, proc, from, to)\
   956 	{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, proc), SLEG_GENERAL(sle_cmd, var, type | flags, length, from, to)}
   966 	{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, proc, NULL), SLEG_GENERAL(sle_cmd, var, type | flags, length, from, to)}
   957 
   967 
   958 #define SDTG_CONDVAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc, from, to)\
   968 #define SDTG_CONDVAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc, from, to)\
   959 	SDTG_GENERAL(name, SDT_NUMX, SL_VAR, type, flags, guiflags, var, 0, def, min, max, interval, NULL, str, proc, from, to)
   969 	SDTG_GENERAL(name, SDT_NUMX, SL_VAR, type, flags, guiflags, var, 0, def, min, max, interval, NULL, str, proc, from, to)
   960 #define SDTG_VAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc)\
   970 #define SDTG_VAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc)\
   961 	SDTG_CONDVAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc, 0, SL_MAX_VERSION)
   971 	SDTG_CONDVAR(name, type, flags, guiflags, var, def, min, max, interval, str, proc, 0, SL_MAX_VERSION)
   984 	SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, proc, from, to)
   994 	SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, proc, from, to)
   985 #define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, proc)\
   995 #define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, proc)\
   986 	SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION)
   996 	SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION)
   987 
   997 
   988 #define SDTG_CONDNULL(length, from, to)\
   998 #define SDTG_CONDNULL(length, from, to)\
   989 	{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_CONDNULL(length, from, to)}
   999 	{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL, NULL}, SLEG_CONDNULL(length, from, to)}
   990 
  1000 
   991 #define SDTG_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_END()}
  1001 #define SDTG_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL, NULL}, SLEG_END()}
   992 
  1002 
   993 /* Macros for various objects to go in the configuration file.
  1003 /* Macros for various objects to go in the configuration file.
   994  * This section is for structures where their various members are saved */
  1004  * This section is for structures where their various members are saved */
   995 #define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, interval, full, str, proc, from, to)\
  1005 #define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, interval, full, str, proc, load, from, to)\
   996 	{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, proc), SLE_GENERAL(sle_cmd, base, var, type | flags, length, from, to)}
  1006 	{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, proc, load), SLE_GENERAL(sle_cmd, base, var, type | flags, length, from, to)}
   997 
  1007 
   998 #define SDT_CONDVAR(base, var, type, from, to, flags, guiflags, def, min, max, interval, str, proc)\
  1008 #define SDT_CONDVAR(base, var, type, from, to, flags, guiflags, def, min, max, interval, str, proc)\
   999 	SDT_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, base, var, 1, def, min, max, interval, NULL, str, proc, from, to)
  1009 	SDT_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, base, var, 1, def, min, max, interval, NULL, str, proc, NULL, from, to)
  1000 #define SDT_VAR(base, var, type, flags, guiflags, def, min, max, interval, str, proc)\
  1010 #define SDT_VAR(base, var, type, flags, guiflags, def, min, max, interval, str, proc)\
  1001 	SDT_CONDVAR(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, min, max, interval, str, proc)
  1011 	SDT_CONDVAR(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, min, max, interval, str, proc)
  1002 
  1012 
  1003 #define SDT_CONDBOOL(base, var, from, to, flags, guiflags, def, str, proc)\
  1013 #define SDT_CONDBOOL(base, var, from, to, flags, guiflags, def, str, proc)\
  1004 	SDT_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, base, var, 1, def, 0, 1, 0, NULL, str, proc, from, to)
  1014 	SDT_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, base, var, 1, def, 0, 1, 0, NULL, str, proc, NULL, from, to)
  1005 #define SDT_BOOL(base, var, flags, guiflags, def, str, proc)\
  1015 #define SDT_BOOL(base, var, flags, guiflags, def, str, proc)\
  1006 	SDT_CONDBOOL(base, var, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1016 	SDT_CONDBOOL(base, var, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1007 
  1017 
  1008 #define SDT_CONDLIST(base, var, type, from, to, flags, guiflags, def, str, proc)\
  1018 #define SDT_CONDLIST(base, var, type, from, to, flags, guiflags, def, str, proc)\
  1009 	SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, from, to)
  1019 	SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, NULL, from, to)
  1010 #define SDT_LIST(base, var, type, flags, guiflags, def, str, proc)\
  1020 #define SDT_LIST(base, var, type, flags, guiflags, def, str, proc)\
  1011 	SDT_CONDLIST(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1021 	SDT_CONDLIST(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1012 #define SDT_CONDLISTO(base, var, length, type, from, to, flags, guiflags, def, str, proc)\
  1022 #define SDT_CONDLISTO(base, var, length, type, from, to, flags, guiflags, def, str, proc)\
  1013 	SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, length, def, 0, 0, 0, NULL, str, proc, from, to)
  1023 	SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, length, def, 0, 0, 0, NULL, str, proc, NULL, from, to)
  1014 
  1024 
  1015 #define SDT_CONDSTR(base, var, type, from, to, flags, guiflags, def, str, proc)\
  1025 #define SDT_CONDSTR(base, var, type, from, to, flags, guiflags, def, str, proc)\
  1016 	SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, from, to)
  1026 	SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, NULL, from, to)
  1017 #define SDT_STR(base, var, type, flags, guiflags, def, str, proc)\
  1027 #define SDT_STR(base, var, type, flags, guiflags, def, str, proc)\
  1018 	SDT_CONDSTR(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1028 	SDT_CONDSTR(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1019 #define SDT_CONDSTRO(base, var, length, type, from, to, flags, def, str, proc)\
  1029 #define SDT_CONDSTRO(base, var, length, type, from, to, flags, def, str, proc)\
  1020 	SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, 0, base, var, length, def, 0, 0, NULL, str, proc, from, to)
  1030 	SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, 0, base, var, length, def, 0, 0, NULL, str, proc, from, to)
  1021 
  1031 
  1022 #define SDT_CONDCHR(base, var, from, to, flags, guiflags, def, str, proc)\
  1032 #define SDT_CONDCHR(base, var, from, to, flags, guiflags, def, str, proc)\
  1023 	SDT_GENERAL(#var, SDT_STRING, SL_VAR, SLE_CHAR, flags, guiflags, base, var, 1, def, 0, 0, 0, NULL, str, proc, from, to)
  1033 	SDT_GENERAL(#var, SDT_STRING, SL_VAR, SLE_CHAR, flags, guiflags, base, var, 1, def, 0, 0, 0, NULL, str, proc, NULL, from, to)
  1024 #define SDT_CHR(base, var, flags, guiflags, def, str, proc)\
  1034 #define SDT_CHR(base, var, flags, guiflags, def, str, proc)\
  1025 	SDT_CONDCHR(base, var, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1035 	SDT_CONDCHR(base, var, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
  1026 
  1036 
  1027 #define SDT_CONDOMANY(base, var, type, from, to, flags, guiflags, def, max, full, str, proc)\
  1037 #define SDT_CONDOMANY(base, var, type, from, to, flags, guiflags, def, max, full, str, proc, load)\
  1028 	SDT_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, max, 0, full, str, proc, from, to)
  1038 	SDT_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, max, 0, full, str, proc, load, from, to)
  1029 #define SDT_OMANY(base, var, type, flags, guiflags, def, max, full, str, proc)\
  1039 #define SDT_OMANY(base, var, type, flags, guiflags, def, max, full, str, proc, load)\
  1030 	SDT_CONDOMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, max, full, str, proc)
  1040 	SDT_CONDOMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, max, full, str, proc, load)
  1031 
  1041 
  1032 #define SDT_CONDMMANY(base, var, type, from, to, flags, guiflags, def, full, str, proc)\
  1042 #define SDT_CONDMMANY(base, var, type, from, to, flags, guiflags, def, full, str, proc)\
  1033 	SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, 0, full, str, proc, from, to)
  1043 	SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, 0, full, str, proc, NULL, from, to)
  1034 #define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc)\
  1044 #define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc)\
  1035 	SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc)
  1045 	SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc)
  1036 
  1046 
  1037 #define SDT_CONDNULL(length, from, to)\
  1047 #define SDT_CONDNULL(length, from, to)\
  1038 	{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_CONDNULL(length, from, to)}
  1048 	{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL, NULL}, SLE_CONDNULL(length, from, to)}
  1039 
  1049 
  1040 #define SDT_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_END()}
  1050 #define SDT_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, NULL, NULL}, SLE_END()}
  1041 
  1051 
  1042 /* Shortcuts for macros below. Logically if we don't save the value
  1052 /* Shortcuts for macros below. Logically if we don't save the value
  1043  * we also don't sync it in a network game */
  1053  * we also don't sync it in a network game */
  1044 #define S SLF_SAVE_NO | SLF_NETWORK_NO
  1054 #define S SLF_SAVE_NO | SLF_NETWORK_NO
  1045 #define NS SLF_SAVE_NO
  1055 #define NS SLF_SAVE_NO
  1147 static int32 EngineRenewMoneyUpdate(int32 p1)
  1157 static int32 EngineRenewMoneyUpdate(int32 p1)
  1148 {
  1158 {
  1149 	DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
  1159 	DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
  1150 	return 0;
  1160 	return 0;
  1151 }
  1161 }
       
  1162 /** Conversion callback for _gameopt_settings.landscape
       
  1163  * It converts (or try) between old values and the new ones,
       
  1164  * without loosing initial setting  of the user
       
  1165  * @param value that was read from config file
       
  1166  * @return the "hopefully" converted value
       
  1167  */
       
  1168 static int32 ConvertLandscape(const char *value)
       
  1169 {
       
  1170 	/* try with the old values */
       
  1171 	return lookup_oneofmany("normal|hilly|desert|candy", value, -1);
       
  1172 }
       
  1173 
  1152 /* End - Callback Functions */
  1174 /* End - Callback Functions */
  1153 
  1175 
  1154 #ifndef EXTERNAL_PLAYER
  1176 #ifndef EXTERNAL_PLAYER
  1155 #define EXTERNAL_PLAYER "timidity"
  1177 #define EXTERNAL_PLAYER "timidity"
  1156 #endif
  1178 #endif
  1239 	 * it funny to have the GameDifficulty struct be an array while it is a struct of
  1261 	 * it funny to have the GameDifficulty struct be an array while it is a struct of
  1240 	 * same-sized members
  1262 	 * same-sized members
  1241 	 * XXX - To save file-space and since values are never bigger than about 10? only
  1263 	 * XXX - To save file-space and since values are never bigger than about 10? only
  1242 	 * save the first 16 bits in the savegame. Question is why the values are still int32
  1264 	 * save the first 16 bits in the savegame. Question is why the values are still int32
  1243 	 * and why not byte for example? */
  1265 	 * and why not byte for example? */
  1244 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL,  0, 3),
  1266 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL, NULL,  0, 3),
  1245 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL,  4, 53),
  1267 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, NULL,  4, 53),
  1246 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 20, 0, 0, 0, 0, NULL, STR_NULL, NULL, 54, SL_MAX_VERSION),
  1268 	SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 20, 0, 0, 0, 0, NULL, STR_NULL, NULL, NULL, 54, SL_MAX_VERSION),
  1247 	    SDT_VAR(GameOptions, diff_level,SLE_UINT8, 0, 0, 9, 0,  9, 0, STR_NULL, NULL),
  1269 	    SDT_VAR(GameOptions, diff_level,SLE_UINT8, 0, 0, 9, 0,  9, 0, STR_NULL, NULL),
  1248 	  SDT_OMANY(GameOptions, currency,  SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SIT|SEK|YTL|SKK|BRR|custom", STR_NULL, NULL),
  1270 	  SDT_OMANY(GameOptions, currency,  SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SIT|SEK|YTL|SKK|BRR|custom", STR_NULL, NULL, NULL),
  1249 	  SDT_OMANY(GameOptions, units,     SLE_UINT8, N, 0, 1,     2, "imperial|metric|si", STR_NULL, NULL),
  1271 	  SDT_OMANY(GameOptions, units,     SLE_UINT8, N, 0, 1,     2, "imperial|metric|si", STR_NULL, NULL, NULL),
  1250 	  SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0,    20, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan", STR_NULL, NULL),
  1272 	  SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0,    20, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan", STR_NULL, NULL, NULL),
  1251 	  SDT_OMANY(GameOptions, landscape, SLE_UINT8, 0, 0, 0,     3, "normal|hilly|desert|candy", STR_NULL, NULL),
  1273 	  SDT_OMANY(GameOptions, landscape, SLE_UINT8, 0, 0, 0,     3, "temperate|arctic|tropic|toyland", STR_NULL, NULL, ConvertLandscape),
  1252 	    SDT_VAR(GameOptions, snow_line, SLE_UINT8, 0, 0, 1, 0, 56, 0, STR_NULL, NULL),
  1274 	    SDT_VAR(GameOptions, snow_line, SLE_UINT8, 0, 0, 1, 0, 56, 0, STR_NULL, NULL),
  1253 	SDT_CONDOMANY(GameOptions,autosave, SLE_UINT8, 0, 22,             N, 0, 0, 0, "", STR_NULL, NULL),
  1275 	SDT_CONDOMANY(GameOptions,autosave, SLE_UINT8, 0, 22,             N, 0, 0, 0, "", STR_NULL, NULL, NULL),
  1254 	SDT_CONDOMANY(GameOptions,autosave, SLE_UINT8,23, SL_MAX_VERSION, S, 0, 1, 4, "off|monthly|quarterly|half year|yearly", STR_NULL, NULL),
  1276 	SDT_CONDOMANY(GameOptions,autosave, SLE_UINT8,23, SL_MAX_VERSION, S, 0, 1, 4, "off|monthly|quarterly|half year|yearly", STR_NULL, NULL, NULL),
  1255 	  SDT_OMANY(GameOptions, road_side, SLE_UINT8, 0, 0, 1,   1, "left|right", STR_NULL, NULL),
  1277 	  SDT_OMANY(GameOptions, road_side, SLE_UINT8, 0, 0, 1,   1, "left|right", STR_NULL, NULL, NULL),
  1256 	    SDT_END()
  1278 	    SDT_END()
  1257 };
  1279 };
  1258 
  1280 
  1259 /* Some patches do not need to be synchronised when playing in multiplayer.
  1281 /* Some patches do not need to be synchronised when playing in multiplayer.
  1260  * These include for example the GUI settings and will not be saved with the
  1282  * These include for example the GUI settings and will not be saved with the
  1355 	 SDT_VAR(Patches, snow_line_height,SLE_UINT8, 0, 0,     7,  2, 13, 0, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT,  NULL),
  1377 	 SDT_VAR(Patches, snow_line_height,SLE_UINT8, 0, 0,     7,  2, 13, 0, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT,  NULL),
  1356 	 SDT_VAR(Patches, colored_news_year,SLE_INT32, 0,NC,  2000, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_COLORED_NEWS_YEAR,NULL),
  1378 	 SDT_VAR(Patches, colored_news_year,SLE_INT32, 0,NC,  2000, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_COLORED_NEWS_YEAR,NULL),
  1357 	 SDT_VAR(Patches, starting_year,    SLE_INT32, 0,NC,  1950, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_STARTING_YEAR,NULL),
  1379 	 SDT_VAR(Patches, starting_year,    SLE_INT32, 0,NC,  1950, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_STARTING_YEAR,NULL),
  1358 	 SDT_VAR(Patches, ending_year,      SLE_INT32,0,NC|NO,2051, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_ENDING_YEAR,  NULL),
  1380 	 SDT_VAR(Patches, ending_year,      SLE_INT32,0,NC|NO,2051, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_ENDING_YEAR,  NULL),
  1359 	SDT_BOOL(Patches, smooth_economy,             0, 0,  true,            STR_CONFIG_PATCHES_SMOOTH_ECONOMY,   NULL),
  1381 	SDT_BOOL(Patches, smooth_economy,             0, 0,  true,            STR_CONFIG_PATCHES_SMOOTH_ECONOMY,   NULL),
  1360 	SDT_BOOL(Patches, allow_shares,               0, 0,  true,            STR_CONFIG_PATCHES_ALLOW_SHARES,     NULL),
  1382 	SDT_BOOL(Patches, allow_shares,               0, 0, false,            STR_CONFIG_PATCHES_ALLOW_SHARES,     NULL),
  1361 
  1383 
  1362 	/***************************************************************************/
  1384 	/***************************************************************************/
  1363 	/* AI section of the GUI-configure patches window */
  1385 	/* AI section of the GUI-configure patches window */
  1364 	SDT_BOOL(Patches, ainew_active,           0, 0, false, STR_CONFIG_PATCHES_AINEW_ACTIVE,      AiNew_PatchActive_Warning),
  1386 	SDT_BOOL(Patches, ainew_active,           0, 0, false, STR_CONFIG_PATCHES_AINEW_ACTIVE,      AiNew_PatchActive_Warning),
  1365 	SDT_BOOL(Patches, ai_in_multiplayer,      0, 0, false, STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER, Ai_In_Multiplayer_Warning),
  1387 	SDT_BOOL(Patches, ai_in_multiplayer,      0, 0, false, STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER, Ai_In_Multiplayer_Warning),
  1473 	SDT_CONDVAR (Patches, yapf.road_stop_penalty                     , SLE_UINT, 47, SL_MAX_VERSION, 0, 0,  8 * YAPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
  1495 	SDT_CONDVAR (Patches, yapf.road_stop_penalty                     , SLE_UINT, 47, SL_MAX_VERSION, 0, 0,  8 * YAPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
  1474 
  1496 
  1475 	/***************************************************************************/
  1497 	/***************************************************************************/
  1476 	/* Terrain genation related patch options */
  1498 	/* Terrain genation related patch options */
  1477 	SDT_CONDVAR(Patches,      land_generator,           SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   1,                   0,    1,               0, STR_CONFIG_PATCHES_LAND_GENERATOR,           NULL),
  1499 	SDT_CONDVAR(Patches,      land_generator,           SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   1,                   0,    1,               0, STR_CONFIG_PATCHES_LAND_GENERATOR,           NULL),
  1478 	SDT_CONDVAR(Patches,      oil_refinery_limit,       SLE_UINT8,  30, SL_MAX_VERSION, 0, 0,   16,                  12,   48,               0, STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE,    NULL),
  1500 	SDT_CONDVAR(Patches,      oil_refinery_limit,       SLE_UINT8,  30, SL_MAX_VERSION, 0, 0,   32,                  12,   48,               0, STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE,    NULL),
  1479 	SDT_CONDVAR(Patches,      tgen_smoothness,          SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   1,                   0,    3,               0, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN,     NULL),
  1501 	SDT_CONDVAR(Patches,      tgen_smoothness,          SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   1,                   0,    3,               0, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN,     NULL),
  1480 	SDT_CONDVAR(Patches,      generation_seed,          SLE_UINT32, 30, SL_MAX_VERSION, 0, 0,    GENERATE_NEW_SEED,   0, MAX_UVALUE(uint32), 0, STR_NULL,                                    NULL),
  1502 	SDT_CONDVAR(Patches,      generation_seed,          SLE_UINT32, 30, SL_MAX_VERSION, 0, 0,    GENERATE_NEW_SEED,   0, MAX_UVALUE(uint32), 0, STR_NULL,                                    NULL),
  1481 	SDT_CONDVAR(Patches,      tree_placer,              SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   2,                   0,    2,               0, STR_CONFIG_PATCHES_TREE_PLACER,              NULL),
  1503 	SDT_CONDVAR(Patches,      tree_placer,              SLE_UINT8,  30, SL_MAX_VERSION, 0, MS,   2,                   0,    2,               0, STR_CONFIG_PATCHES_TREE_PLACER,              NULL),
  1482 	SDT_VAR    (Patches,      heightmap_rotation,       SLE_UINT8,                      S, MS,   0,                   0,    1,               0, STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION,       NULL),
  1504 	SDT_VAR    (Patches,      heightmap_rotation,       SLE_UINT8,                      S, MS,   0,                   0,    1,               0, STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION,       NULL),
  1483 	SDT_VAR    (Patches,      se_flat_world_height,     SLE_UINT8,                      S, 0,    0,                   0,   15,               0, STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT,     NULL),
  1505 	SDT_VAR    (Patches,      se_flat_world_height,     SLE_UINT8,                      S, 0,    0,                   0,   15,               0, STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT,     NULL),