X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_caveengine.c;fp=src%2Fgame_bd%2Fbd_caveengine.c;h=5b2bfcdfcd1292268083f70c45a5fa64fd235469;hb=8fdd23c078934ae797980a824fd145903c84cae7;hp=6d0e3fcd2c13614bfa7ad887f9d2c05f1fad1cda;hpb=7e0902aa2014d4f2899972319f56fe9d5f24578d;p=rocksndiamonds.git diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 6d0e3fcd..5b2bfcdf 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -1570,6 +1570,9 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, gd_cave_clear_sounds(cave); + game_bd.player_moving = FALSE; + game_bd.player_snapping = FALSE; + // if diagonal movements not allowed, // horizontal movements have precedence. [BROADRIBB] if (!cave->diagonal_movements) @@ -1835,15 +1838,25 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, // if snapping anything and we have snapping explosions set. // but these is not true for pushing. if (remains == O_SPACE && player_fire && !push) + { remains = cave->snap_element; + game_bd.player_snapping = TRUE; + } + if (remains != O_SPACE || player_fire) + { // if any other element than space, player cannot move. // also if pressing fire, will not move. store_dir(cave, x, y, player_move, remains); + } else + { // if space remains there, the player moves. move(cave, x, y, player_move, O_PLAYER); + + game_bd.player_moving = TRUE; + } } } break;