From: Holger Schemel Date: Sun, 22 Sep 2024 19:23:25 +0000 (+0200) Subject: fixed broken BD player pushing animation when pushing an element X-Git-Tag: 4.4.0.0-test-4~205 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b1e0fc319a6d8da28f9bde19a55cd2302eee32b4;p=rocksndiamonds.git fixed broken BD player pushing animation when pushing an element --- diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index 50c28ff2..42a31d3a 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -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_PUSHING, // player pushing some 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 @@ -165,6 +166,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_PUSHING (1 << E_P_PLAYER_PUSHING) #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) diff --git a/src/game_bd/bd_cavedb.c b/src/game_bd/bd_cavedb.c index 15821282..1fd326ab 100644 --- a/src/game_bd/bd_cavedb.c +++ b/src/game_bd/bd_cavedb.c @@ -1770,12 +1770,12 @@ GdElementProperty gd_element_properties[] = }, { O_PLAYER_PUSH_LEFT, O_PLAYER_PUSH_LEFT, N_("Player, pushing left"), - P_PLAYER, + P_PLAYER | P_PLAYER_PUSHING, NULL, 0, 392, -392, -392 }, { O_PLAYER_PUSH_RIGHT, O_PLAYER_PUSH_RIGHT, N_("Player, pushing right"), - P_PLAYER, + P_PLAYER | P_PLAYER_PUSHING, NULL, 0, 400, -400, -400 }, { diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index cc7a7bd7..bfa5b9ad 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -554,6 +554,12 @@ static inline boolean el_player(const int element) return has_property(element, P_PLAYER); } +// returns true if the element is a player who is pushing some element +static inline boolean el_player_pushing(const int element) +{ + return has_property(element, P_PLAYER_PUSHING); +} + #if 0 // returns true if the element is walkable static inline boolean el_walkable(const int element) @@ -707,7 +713,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d } // player killed by lava or explosion was standing still before moving into lava or enemy - if (el_player(tile_from)) + if (el_player(tile_from) && !el_player_pushing(draw_from)) draw_from = (dir_from == GD_MV_LEFT ? O_PLAYER_LEFT : dir_from == GD_MV_RIGHT ? O_PLAYER_RIGHT : dir_from == GD_MV_UP ? O_PLAYER_UP :