fixed using BD player pushing animation while stirring the pot
authorHolger Schemel <holger.schemel@virtion.de>
Sun, 22 Sep 2024 18:31:57 +0000 (20:31 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Sun, 22 Sep 2024 18:32:00 +0000 (20:32 +0200)
src/game_bd/bd_cave.c
src/game_bd/bd_cave.h
src/game_bd/bd_cavedb.c
src/game_bd/bd_caveengine.c
src/game_bd/bd_caveengine.h

index cdd82f198485743967a32ac65c66f39af67fb710..fe8ab4472474c1832a13977a8bdc1b727b52412e 100644 (file)
@@ -1625,10 +1625,11 @@ void gd_drawcave_game(const GdCave *cave,
        draw = elemdrawing[actual];
       }
 
-      // draw special graphics if player is pushing something
+      // draw special graphics if player is pushing something (but not while stirring the pot)
       if (use_bd_pushing_graphics() &&
          (cave->last_direction == GD_MV_LEFT || cave->last_direction == GD_MV_RIGHT) &&
-         is_player(cave, x, y) && can_be_pushed(cave, x, y, cave->last_direction))
+         is_player(cave, x, y) && can_be_pushed(cave, x, y, cave->last_direction) &&
+         !is_player_stirring(cave, x, y))
       {
        // special check needed when smooth game element movements selected in setup menu:
        // last element must either be player (before pushing) or pushable element (while pushing)
index e3495ce1d0c3887bb38759e76dc6dde7773cb550..50c28ff283b79ec9f4d698c9fcc3470ff97cf5f7 100644 (file)
@@ -120,6 +120,7 @@ enum _element_property_enum
   E_P_VISUAL_EFFECT,            // if the element can use a visual effect.
                                // used to check consistency of the code
   E_P_PLAYER,                   // easier to find out if it is a player element
+  E_P_PLAYER_STIRRING,          // player stirring the pot
   E_P_MOVED_BY_CONVEYOR_TOP,    // can be moved by conveyor belt
   E_P_MOVED_BY_CONVEYOR_BOTTOM, // can be moved UNDER the conveyor belt
 
@@ -164,6 +165,7 @@ enum _element_property_enum
 #define P_CAN_BE_HAMMERED              (1 << E_P_CAN_BE_HAMMERED)
 #define P_VISUAL_EFFECT                        (1 << E_P_VISUAL_EFFECT)
 #define P_PLAYER                       (1 << E_P_PLAYER)
+#define P_PLAYER_STIRRING              (1 << E_P_PLAYER_STIRRING)
 #define P_MOVED_BY_CONVEYOR_TOP                (1 << E_P_MOVED_BY_CONVEYOR_TOP)
 #define P_MOVED_BY_CONVEYOR_BOTTOM     (1 << E_P_MOVED_BY_CONVEYOR_BOTTOM)
 
index 87347c457deb65e6a9ab6dc19dffcb02ffc9b547..1582128238b87624b2c7c4c4bed7aa6479c1defc 100644 (file)
@@ -1279,7 +1279,7 @@ GdElementProperty gd_element_properties[] =
   },    // is not a real player! so active x, y will not find it. no P_PLAYER bit!
   {
     O_PLAYER_STIRRING, O_PLAYER_STIRRING, N_("Player stirring"),
-    P_BLOWS_UP_FLIES | P_EXPLODES_BY_HIT | P_PLAYER,
+    P_BLOWS_UP_FLIES | P_EXPLODES_BY_HIT | P_PLAYER | P_PLAYER_STIRRING,
     "GUYSTIRRING", 0, 256, -256, -256
   },
 
index 42f3b3eba63493d49db970fbbd06eaa2c22008fa..69c986786b1ef2d25a0a646d180ba93f4982582a 100644 (file)
@@ -493,6 +493,12 @@ boolean is_player(const GdCave *cave, const int x, const int y)
   return has_property(get(cave, x, y), P_PLAYER);
 }
 
+// returns true if the element is a player stirring the pot
+boolean is_player_stirring(const GdCave *cave, const int x, const int y)
+{
+  return has_property(get(cave, x, y), P_PLAYER_STIRRING);
+}
+
 // returns true if the element is a player (normal player, player glued, player with bomb) (+ dir)
 static inline boolean is_player_dir(const GdCave *cave, const int x, const int y,
                                    const GdDirection dir)
index 81dcfc77ba4562092af9a20b56116fe851ac3b7b..c1e91bf3de9cf5baaebeeabed265fd8d8e622410 100644 (file)
@@ -25,6 +25,7 @@ boolean is_scanned_element(GdElement e);
 GdElement scanned_pair(GdElement of_what);
 GdElement non_scanned_pair(GdElement of_what);
 boolean is_player(const GdCave *cave, const int x, const int y);
+boolean is_player_stirring(const GdCave *cave, const int x, const int y);
 boolean can_be_pushed(const GdCave *cave, const int x, const int y, const GdDirection dir);
 GdDirection gd_direction_from_keypress(boolean up, boolean down, boolean left, boolean right);
 void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, boolean suicide);