Ensure correct language is used for scan-objects

This commit is contained in:
Ted John 2018-04-20 00:12:40 +01:00
parent edb9dc39ab
commit 4ce4101ac5
1 changed files with 4 additions and 3 deletions

View File

@ -397,12 +397,13 @@ static exitcode_t HandleCommandScanObjects(CommandLineArgEnumerator * enumerator
gOpenRCT2Headless = true;
// HACK: set gCurrentLanguage otherwise it be wrong for the index file
gCurrentLanguage = gConfigGeneral.language;
auto context = std::unique_ptr<OpenRCT2::IContext>(OpenRCT2::CreateContext());
auto env = context->GetPlatformEnvironment();
auto objectRepository = std::unique_ptr<IObjectRepository>(CreateObjectRepository(env));
// HACK: set gCurrentLanguage otherwise it be wrong for the index file
gCurrentLanguage = gConfigGeneral.language;
objectRepository->Construct();
return EXITCODE_OK;
}