* Tries to reset the engine mapping to match the current NewGRF configuration. * This is only possible when there are currently no vehicles in the game. * @return false if resetting failed due to present vehicles. */
| 582 | * @return false if resetting failed due to present vehicles. |
| 583 | */ |
| 584 | bool EngineOverrideManager::ResetToCurrentNewGRFConfig() |
| 585 | { |
| 586 | for (const Vehicle *v : Vehicle::Iterate()) { |
| 587 | if (IsCompanyBuildableVehicleType(v)) return false; |
| 588 | } |
| 589 | |
| 590 | /* Reset the engines, they will get new EngineIDs */ |
| 591 | _engine_mngr.ResetToDefaultMapping(); |
| 592 | ReloadNewGRFData(); |
| 593 | |
| 594 | return true; |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * Initialise the engine pool with the data from the original vehicles. |
nothing calls this directly
no test coverage detected