Fix autoclose command + condition to pause the console only if no debugger and no autoclose

This commit is contained in:
2026-02-16 11:13:53 -05:00
parent b6e9d95552
commit 762cfe52cf
7 changed files with 112 additions and 15 deletions

View File

@@ -498,15 +498,15 @@ JulietApplication& GetEditorApplication()
return EditorApplication;
}
int JulietMain(int, wchar_t**)
int JulietMain(int argc, wchar_t** argv)
{
if (__argc > 1)
if (argc > 1)
{
for (int i = 1; i < __argc; ++i)
for (int i = 1; i < argc; ++i)
{
if (strcmp(__argv[i], "-autoclose") == 0 && (i + 1 < __argc))
if (wcscmp(argv[i], L"-autoclose") == 0 && (i + 1 < argc))
{
int frames = atoi(__argv[i + 1]);
int frames = _wtoi(argv[i + 1]);
EditorApplication.SetAutoCloseFrameCount(frames);
}
}
@@ -516,7 +516,7 @@ int JulietMain(int, wchar_t**)
// Pause here to not close the console window immediatly on stop
// Only pause if not in auto-close mode
if (EditorApplication.GetAutoCloseFrameCount() == -1)
if (EditorApplication.GetAutoCloseFrameCount() == -1 && !Debug::IsDebuggerPresent())
{
system("PAUSE");
}