diff options
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 5d4e713be..30201541c 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -36,7 +36,6 @@ #include "train.h" #include "news_func.h" #include "window_func.h" -#include "vehicle_func.h" #include "sound_func.h" #include "company_func.h" #include "rev.h" @@ -58,7 +57,6 @@ #include "ini_type.h" #include "ai/ai_config.hpp" #include "ai/ai.hpp" -#include "newgrf.h" #include "ship.h" #include "smallmap_gui.h" #include "roadveh.h" @@ -1133,18 +1131,11 @@ static bool ChangeDynamicEngines(int32 p1) { if (_game_mode == GM_MENU) return true; - const Vehicle *v; - FOR_ALL_VEHICLES(v) { - if (IsCompanyBuildableVehicleType(v)) { - ShowErrorMessage(STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES, INVALID_STRING_ID, WL_ERROR); - return false; - } + if (!EngineOverrideManager::ResetToCurrentNewGRFConfig()) { + ShowErrorMessage(STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES, INVALID_STRING_ID, WL_ERROR); + return false; } - /* Reset the engines, they will get new EngineIDs */ - _engine_mngr.ResetToDefaultMapping(); - ReloadNewGRFData(); - return true; } |