From: Holger Schemel Date: Wed, 6 Mar 2024 08:04:21 +0000 (+0100) Subject: added functions to check game element properties (not used yet) X-Git-Tag: 4.4.0.0-test-1~254 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2d24a1c9f9bc9bbb854999ea817da2017682f74d;p=rocksndiamonds.git added functions to check game element properties (not used yet) --- diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 084fb3f0..fdf237f0 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -291,12 +291,36 @@ static inline boolean is_player(const int element) return (gd_elements[element & O_MASK].properties & P_PLAYER) != 0; } +// returns true if the element is diggable +static inline boolean is_diggable(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_DIGGABLE) != 0; +} + // returns true if the element is collectible static inline boolean is_collectible(const int element) { return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0; } +// returns true if the element is pushable +static inline boolean is_pushable(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_PUSHABLE) != 0; +} + +// returns true if the element can move +static inline boolean can_move(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_CAN_MOVE) != 0; +} + +// returns true if the element can fall +static inline boolean can_fall(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_CAN_FALL) != 0; +} + // returns true if the element is exploding static inline boolean is_explosion(const int element) {