1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00

fixed gExitCode

This commit is contained in:
Lomash Gupta
2019-10-05 12:57:07 -04:00
committed by Tulio Leao
parent d798811c4a
commit 36840f3fe0
5 changed files with 13 additions and 13 deletions

View File

@@ -27,7 +27,9 @@ int main(int argc, const char** argv)
// Run OpenRCT2 with a plain context
auto context = CreateContext();
context->RunOpenRCT2(argc, argv);
if((context->RunOpenRCT2(argc, argv)) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
}
return gExitCode;
return EXIT_FAILURE;
}

View File

@@ -38,6 +38,7 @@ int NormalisedMain(int argc, const char** argv)
int main(int argc, const char** argv)
#endif
{
std::unique_ptr<IContext> context;
int runGame = cmdline_run(argv, argc);
core_init();
RegisterBitmapReader();
@@ -46,8 +47,7 @@ int main(int argc, const char** argv)
if (gOpenRCT2Headless)
{
// Run OpenRCT2 with a plain context
auto context = CreateContext();
context->RunOpenRCT2(argc, argv);
context = CreateContext();
}
else
{
@@ -55,12 +55,13 @@ int main(int argc, const char** argv)
auto env = to_shared(CreatePlatformEnvironment());
auto audioContext = to_shared(CreateAudioContext());
auto uiContext = to_shared(CreateUiContext(env));
auto context = CreateContext(env, audioContext, uiContext);
context->RunOpenRCT2(argc, argv);
context = CreateContext(env, audioContext, uiContext);
}
if (context->RunOpenRCT2(argc, argv) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
}
return gExitCode;
return EXIT_FAILURE;
}
#ifdef __ANDROID__

View File

@@ -243,8 +243,9 @@ namespace OpenRCT2
if (Initialise())
{
Launch();
return EXIT_SUCCESS;
}
return gExitCode;
return EXIT_FAILURE;
}
void WriteLine(const std::string& s) override

View File

@@ -9,7 +9,6 @@
#include "OpenRCT2.h"
int32_t gExitCode;
int32_t gOpenRCT2StartupAction = STARTUP_ACTION_TITLE;
utf8 gOpenRCT2StartupActionPath[512] = { 0 };
utf8 gExePath[MAX_PATH];

View File

@@ -34,9 +34,6 @@ enum
SCREEN_FLAGS_EDITOR = (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER),
};
/** The exit code for OpenRCT2 when it exits. */
extern int32_t gExitCode;
extern int32_t gOpenRCT2StartupAction;
extern utf8 gOpenRCT2StartupActionPath[512];
extern utf8 gExePath[MAX_PATH];