|
@@ -426,13 +426,13 @@ void CheckDifficultyLevels()
|
|
|
{
|
|
|
if (_opt_newgame.diff_level != 3) {
|
|
|
SetDifficultyLevel(_opt_newgame.diff_level, &_opt_newgame);
|
|
|
} else {
|
|
|
for (uint i = 0; i < GAME_DIFFICULTY_NUM; i++) {
|
|
|
GDType *diff = ((GDType*)&_opt_newgame.diff) + i;
|
|
|
*diff = clamp(*diff, _game_setting_info[i].min, _game_setting_info[i].max);
|
|
|
*diff = Clamp(*diff, _game_setting_info[i].min, _game_setting_info[i].max);
|
|
|
*diff -= *diff % _game_setting_info[i].step;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
extern void StartupEconomy();
|
|
@@ -1146,13 +1146,13 @@ static void CustCurrencyWndProc(Window *
|
|
|
if (x < 20) {
|
|
|
_custom_currency.to_euro = (_custom_currency.to_euro <= 2000) ?
|
|
|
CF_NOEURO : _custom_currency.to_euro - 1;
|
|
|
WP(w,def_d).data_1 = 1 << (line * 2 + 0);
|
|
|
} else {
|
|
|
_custom_currency.to_euro =
|
|
|
clamp(_custom_currency.to_euro + 1, 2000, MAX_YEAR);
|
|
|
Clamp(_custom_currency.to_euro + 1, 2000, MAX_YEAR);
|
|
|
WP(w,def_d).data_1 = 1 << (line * 2 + 1);
|
|
|
}
|
|
|
} else { // enter text
|
|
|
SetDParam(0, _custom_currency.to_euro);
|
|
|
str = STR_CONFIG_PATCHES_INT32;
|
|
|
len = 4;
|
|
@@ -1173,13 +1173,13 @@ static void CustCurrencyWndProc(Window *
|
|
|
|
|
|
case WE_ON_EDIT_TEXT: {
|
|
|
const char *b = e->we.edittext.str;
|
|
|
|
|
|
switch (WP(w,def_d).data_2) {
|
|
|
case 0: /* Exchange rate */
|
|
|
_custom_currency.rate = clamp(atoi(b), 1, 5000);
|
|
|
_custom_currency.rate = Clamp(atoi(b), 1, 5000);
|
|
|
break;
|
|
|
|
|
|
case 1: /* Thousands seperator */
|
|
|
_custom_currency.separator = (b[0] == '\0') ? ' ' : b[0];
|
|
|
ttd_strlcpy(_str_separator, b, lengthof(_str_separator));
|
|
|
break;
|