From c8169758d3caf6b8bd573595a28d2561ab425eed Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 31 Aug 2017 18:34:21 +0100 Subject: [PATCH] Re-implement scan-objects command line tool --- src/openrct2/cmdline/RootCommands.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 829240b60c..c7cf5498dd 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -23,6 +23,7 @@ extern "C" #include "../config/Config.h" #include "../platform/crash.h" #include "../platform/platform.h" + #include "../localisation/language.h" } #include "../core/Console.hpp" @@ -32,6 +33,7 @@ extern "C" #include "../network/network.h" #include "../object/ObjectRepository.h" #include "../OpenRCT2.h" +#include "../PlatformEnvironment.h" #include "../Version.h" #include "CommandLine.hpp" @@ -397,9 +399,13 @@ static exitcode_t HandleCommandScanObjects(CommandLineArgEnumerator * enumerator return result; } - // IPlatformEnvironment * env = OpenRCT2::SetupEnvironment(); - // IObjectRepository * objectRepository = CreateObjectRepository(env); - // objectRepository->Construct(); + auto env = OpenRCT2::CreatePlatformEnvironment(); + + // HACK: set gCurrentLanguage otherwise it be wrong for the index file + gCurrentLanguage = gConfigGeneral.language; + + auto objectRepository = CreateObjectRepository(env); + objectRepository->Construct(); return EXITCODE_OK; }