From 4ce4101ac58ad4b9bb3f4cb72215d50a660be4de Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 20 Apr 2018 00:12:40 +0100 Subject: [PATCH] Ensure correct language is used for scan-objects --- src/openrct2/cmdline/RootCommands.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 080350ec54..c42009b293 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -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::CreateContext()); auto env = context->GetPlatformEnvironment(); auto objectRepository = std::unique_ptr(CreateObjectRepository(env)); + + // HACK: set gCurrentLanguage otherwise it be wrong for the index file + gCurrentLanguage = gConfigGeneral.language; + objectRepository->Construct(); return EXITCODE_OK; }