fix: only open debug overlay when ingame, to avoid crashes

This commit is contained in:
jeanmajid 2026-03-02 01:13:38 +01:00
parent 00b9079c18
commit 322b808ae0

View file

@ -1238,7 +1238,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
{
if (Minecraft* pMinecraft = Minecraft::GetInstance())
{
if (pMinecraft->options && app.DebugSettingsOn())
if (pMinecraft->options && app.DebugSettingsOn() &&
app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
{
ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);
}