Reload addons and grand prix info after downloading assets

This commit is contained in:
Benau 2019-08-12 10:21:57 +08:00
parent 819fa6537b
commit c8e3d5b512
2 changed files with 10 additions and 0 deletions

View File

@ -436,6 +436,11 @@ void FileManager::reinitAfterDownloadAssets()
m_music_search_path.clear();
discoverPaths();
addAssetsSearchPath();
// Add back addons search path
KartPropertiesManager::addKartSearchDir(
file_manager->getAddonsFile("karts/"));
track_manager->addTrackSearchDir(
file_manager->getAddonsFile("tracks/"));
} // reinitAfterDownloadAssets
//-----------------------------------------------------------------------------

View File

@ -21,6 +21,7 @@
#include "addons/zip.hpp"
#include "io/file_manager.hpp"
#include "graphics/irr_driver.hpp"
#include "race/grand_prix_manager.hpp"
#include "tracks/track_manager.hpp"
#include "utils/constants.hpp"
#include "utils/log.hpp"
@ -76,6 +77,10 @@ void ExtractMobileAssets::reinit()
file_manager->reinitAfterDownloadAssets();
irr_driver->sameRestart();
track_manager->loadTrackList();
delete grand_prix_manager;
grand_prix_manager = new GrandPrixManager();
grand_prix_manager->checkConsistency();
} // reinit
// ----------------------------------------------------------------------------