From: Holger Schemel Date: Wed, 6 Mar 2024 08:10:26 +0000 (+0100) Subject: fixed potential crash bug in BD engine X-Git-Tag: 4.4.0.0-test-1~251 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5edfe76e94d71fa7b0024c8ddf74fddf5d26160d;p=rocksndiamonds.git fixed potential crash bug in BD engine --- diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index fdf237f0..d355212e 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -398,7 +398,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d int dy = (dir == GD_MV_UP ? +1 : dir == GD_MV_DOWN ? -1 : 0); int old_x = cave->getx(cave, x + dx, y + dy); int old_y = cave->gety(cave, x + dx, y + dy); - int tile_from = game->element_buffer[old_y][old_x]; + int tile_from = game->element_buffer[old_y][old_x] & ~SKIPPED; // should never be skipped struct GraphicInfo_BD *g_from = &graphic_info_bd_object[tile_from][frame]; boolean old_is_player = is_player(tile_from); boolean old_is_moving = (game->dir_buffer[old_y][old_x] != GD_MV_STILL);