mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 07:14:31 +01:00
fixed gExitCode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -243,8 +243,9 @@ namespace OpenRCT2
|
||||
if (Initialise())
|
||||
{
|
||||
Launch();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
return gExitCode;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
void WriteLine(const std::string& s) override
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "OpenRCT2.h"
|
||||
|
||||
int32_t gExitCode;
|
||||
int32_t gOpenRCT2StartupAction = STARTUP_ACTION_TITLE;
|
||||
utf8 gOpenRCT2StartupActionPath[512] = { 0 };
|
||||
utf8 gExePath[MAX_PATH];
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user