fixed using invalid edit mode in level editor
authorHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 11:12:21 +0000 (13:12 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 11:12:21 +0000 (13:12 +0200)
src/editor.c

index 95d30a88e2f41a72ac3859aeb457d1ad1c856c93..7566391988dbcdb635f32465cdab4ad98fe0afd2 100644 (file)
@@ -11573,6 +11573,11 @@ static void DrawLevelConfigWindow(void)
 
   stick_element_properties_window = FALSE;
 
+  // make sure that previous level config edit mode exists for this level
+  if (edit_mode_levelconfig == ED_MODE_LEVELCONFIG_ENGINE &&
+      level.game_engine_type != GAME_ENGINE_TYPE_BD)
+    edit_mode_levelconfig = ED_MODE_LEVELCONFIG_LEVEL;
+
   SetAutomaticNumberOfGemsNeeded();
 
   UnmapLevelEditorFieldGadgets();