added macros for some game elements
authorHolger Schemel <info@artsoft.org>
Fri, 8 Mar 2024 13:02:45 +0000 (14:02 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 8 Mar 2024 13:02:45 +0000 (14:02 +0100)
src/editor.c
src/main.h

index 0c3ec36fd5b9ab1f5da750337eb8a39c9536a7fd..f02252c5cc98a1aef3d3a48a7bf84d2c6b62760f 100644 (file)
@@ -10608,14 +10608,12 @@ static boolean checkPropertiesConfig(int element)
       IS_MM_MCDUFFIN(element) ||
       IS_DF_LASER(element) ||
       IS_PLAYER_ELEMENT(element) ||
+      IS_BD_PLAYER_ELEMENT(element) ||
+      IS_SOKOBAN_OBJECT_OR_FIELD(element) ||
       HAS_EDITOR_CONTENT(element) ||
       CAN_GROW(element) ||
       COULD_MOVE_INTO_ACID(element) ||
-      MAYBE_DONT_COLLIDE_WITH(element) ||
-      element == EL_BD_PLAYER ||
-      element == EL_SOKOBAN_OBJECT ||
-      element == EL_SOKOBAN_FIELD_EMPTY ||
-      element == EL_SOKOBAN_FIELD_FULL)
+      MAYBE_DONT_COLLIDE_WITH(element))
     return TRUE;
   else
     for (i = 0; elements_with_counter[i].element != -1; i++)
@@ -10847,7 +10845,7 @@ static void DrawPropertiesConfig(void)
     }
   }
 
-  if (properties_element == EL_BD_PLAYER)
+  if (IS_BD_PLAYER_ELEMENT(properties_element))
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_DIAGONAL_MOVEMENTS);
 
   if (IS_GEM(properties_element))
index d1ee5b603ea6812435e23bc8173f45d870e8ddb3..9a54263f204e3aace9ce1e5ab7a81cb6af8966e1 100644 (file)
                                         (e) == EL_PEARL          ? EL_BOMB    :    \
                                         (e) == EL_CRYSTAL        ? EL_CRYSTAL :    \
                                         EL_ROCK)
+
+#define IS_BD_PLAYER_ELEMENT(e)                ((e) == EL_BD_INBOX ||                  \
+                                        (e) == EL_BD_PLAYER ||                 \
+                                        (e) == EL_BD_PLAYER_WITH_BOMB ||       \
+                                        (e) == EL_BD_PLAYER_GLUED ||           \
+                                        (e) == EL_BD_PLAYER_STIRRING)
+
+#define IS_SOKOBAN_OBJECT_OR_FIELD(e)  ((e) == EL_SOKOBAN_OBJECT ||            \
+                                        (e) == EL_SOKOBAN_FIELD_EMPTY ||       \
+                                        (e) == EL_SOKOBAN_FIELD_FULL)
+
 #define IS_DRAWABLE(e)                 ((e) < EL_BLOCKED)
 #define IS_NOT_DRAWABLE(e)             ((e) >= EL_BLOCKED)
 #define TAPE_IS_EMPTY(x)               ((x).length == 0)