Changeset - r13078:0d7c9c57f045
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-09-20 17:19:45
rubidium@openttd.org
(svn r17588) -Fix [FS#3220]: erroneous message about changing the difficulty level
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -710,36 +710,36 @@ public:
 
				this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
 
				this->SetDirty();
 
				break;
 

	
 
			case GDW_HIGHSCORE: // Highscore Table
 
				ShowHighscoreTable(this->opt_mod_temp.difficulty.diff_level, -1);
 
				break;
 

	
 
			case GDW_ACCEPT: { // Save button - save changes
 
				GameSettings *opt_ptr = (_game_mode == GM_MENU) ? &_settings_newgame : &_settings_game;
 

	
 
				uint i;
 
				GetSettingFromName("difficulty.diff_level", &i);
 
				DoCommandP(0, i, this->opt_mod_temp.difficulty.diff_level, CMD_CHANGE_SETTING);
 

	
 
				const SettingDesc *sd = GetSettingFromName("difficulty.max_no_competitors", &i);
 
				for (uint btn = 0; btn != GAME_DIFFICULTY_NUM; btn++, sd++) {
 
					int32 new_val = (int32)ReadValue(GetVariableAddress(&this->opt_mod_temp, &sd->save), sd->save.conv);
 
					int32 cur_val = (int32)ReadValue(GetVariableAddress(opt_ptr, &sd->save), sd->save.conv);
 
					/* if setting has changed, change it */
 
					if (new_val != cur_val) {
 
						DoCommandP(0, i + btn, new_val, CMD_CHANGE_SETTING);
 
					}
 
				}
 

	
 
				GetSettingFromName("difficulty.diff_level", &i);
 
				DoCommandP(0, i, this->opt_mod_temp.difficulty.diff_level, CMD_CHANGE_SETTING);
 
				delete this;
 
				/* If we are in the editor, we should reload the economy.
 
				 * This way when you load a game, the max loan and interest rate
 
				 * are loaded correctly. */
 
				if (_game_mode == GM_EDITOR) StartupEconomy();
 
				break;
 
			}
 

	
 
			case GDW_CANCEL: // Cancel button - close window, abandon changes
 
				delete this;
 
				break;
 
		}
0 comments (0 inline, 0 general)