fixed showing special toolbox buttons for empty space elements in editor
authorHolger Schemel <info@artsoft.org>
Sat, 1 Apr 2023 08:22:56 +0000 (10:22 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 1 Apr 2023 08:22:56 +0000 (10:22 +0200)
src/editor.c

index 41bb5d887d8a4b6eb8c00651291af7d212bee41a..4f29f028a7bc245c1b3abb4222aae4095c0f6be2 100644 (file)
@@ -8181,6 +8181,12 @@ static boolean CopyCustomElement(int element_old, int element_new,
 
     return FALSE;
   }
+  else if (IS_EMPTY_ELEMENT(element_old) && !IS_EMPTY_ELEMENT(element_new))
+  {
+    Request("Please choose empty element!", REQ_CONFIRM);
+
+    return FALSE;
+  }
   else
   {
     level.changed = TRUE;
@@ -10677,7 +10683,8 @@ static void DrawPropertiesWindow(void)
   UnmapLevelEditorToolboxCustomGadgets();
 
   if (IS_CUSTOM_ELEMENT(properties_element) ||
-      IS_GROUP_ELEMENT(properties_element))
+      IS_GROUP_ELEMENT(properties_element) ||
+      IS_EMPTY_ELEMENT(properties_element))
     MapLevelEditorToolboxCustomGadgets();
 
   SetMainBackgroundImage(IMG_BACKGROUND_EDITOR);