From 2d2b7f723bc1439732732bfbd61d5f3101f558f2 Mon Sep 17 00:00:00 2001 From: garak Date: Wed, 22 Feb 2023 15:51:16 -0500 Subject: [PATCH] api util setMainTab ignores command when in layout only mode --- src/scriptapi/apiutility.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scriptapi/apiutility.cpp b/src/scriptapi/apiutility.cpp index 712a8171..1b8d8afe 100644 --- a/src/scriptapi/apiutility.cpp +++ b/src/scriptapi/apiutility.cpp @@ -144,6 +144,9 @@ void ScriptUtility::setMainTab(int index) { // Can't select Wild Encounters tab if it's disabled if (index == 4 && !userConfig.getEncounterJsonActive()) return; + // don't change tab when not editing a map + if (!window->editor || !window->editor->map) + return; window->on_mainTabBar_tabBarClicked(index); }