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; }