mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix #9477: Fix process exit code always being zero
- Replaced gExitCode occurences with EXIT_SUCCESS and EXIT_FAILURE - Removed global declaration of gExitCode
This commit is contained in:
@@ -18,6 +18,7 @@ using namespace OpenRCT2;
|
||||
*/
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
int32_t rc = EXIT_SUCCESS;
|
||||
int runGame = cmdline_run(argv, argc);
|
||||
core_init();
|
||||
if (runGame == 1)
|
||||
@@ -27,9 +28,11 @@ int main(int argc, const char** argv)
|
||||
|
||||
// Run OpenRCT2 with a plain context
|
||||
auto context = CreateContext();
|
||||
if((context->RunOpenRCT2(argc, argv)) == EXIT_SUCCESS) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
rc = context->RunOpenRCT2(argc, argv);
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
else if (runGame == -1)
|
||||
{
|
||||
rc = EXIT_FAILURE;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ int main(int argc, const char** argv)
|
||||
#endif
|
||||
{
|
||||
std::unique_ptr<IContext> context;
|
||||
int32_t rc = EXIT_SUCCESS;
|
||||
int runGame = cmdline_run(argv, argc);
|
||||
core_init();
|
||||
RegisterBitmapReader();
|
||||
@@ -57,11 +58,13 @@ int main(int argc, const char** argv)
|
||||
auto uiContext = to_shared(CreateUiContext(env));
|
||||
context = CreateContext(env, audioContext, uiContext);
|
||||
}
|
||||
if (context->RunOpenRCT2(argc, argv) == EXIT_SUCCESS) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
rc = context->RunOpenRCT2(argc, argv);
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
else if (runGame == -1)
|
||||
{
|
||||
rc = EXIT_FAILURE;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
Reference in New Issue
Block a user