X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Flogic.c;h=5d00cbf8b78d7b2a49f642daef0e20c7da836786;hb=559df68519c1c2aa3b81689ee747b49fae22c931;hp=6270550dd6ee8c5b36c1a9fd23a1b626038d5fb5;hpb=f645e74fab72d2bc94db81ea937904a865d5831e;p=rocksndiamonds.git diff --git a/src/game_em/logic.c b/src/game_em/logic.c index 6270550d..5d00cbf8 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -214,6 +214,22 @@ static void Lboom_eater_new(int x, int y, boolean chain_explosion) Lboom_eater(x, y); } +static void Lboom_cave_new(int x, int y, int element) +{ + if (game_em.use_old_explosions) + return; + + cave[x][y] = element; +} + +static void Lboom_next_new(int x, int y, int element) +{ + if (game_em.use_old_explosions) + return; + + next[x][y] = element; +} + static boolean player_killed(struct PLAYER *ply) { int x = ply->x; @@ -1279,6 +1295,11 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) } } + /* check for wrap-around movement */ + if (ply->x < lev.left || + ply->x > lev.right - 1) + play_element_sound(oldx, oldy, SOUND_door, Xdoor_1); + return result; } @@ -4472,7 +4493,7 @@ static void Lstone_fall(int x, int y) case Xeater_s: case Xeater_w: cave[x][y] = Ystone_sB; - next[x][y] = Xblank; + Lboom_next_new(x, y, Xblank); cave[x][y+1] = Yeater_stone; next[x][y+1] = Zeater; Lboom_eater_old(x, y+1); @@ -4482,7 +4503,7 @@ static void Lstone_fall(int x, int y) case Xalien: case Xalien_pause: cave[x][y] = Ystone_sB; - next[x][y] = Xblank; + Lboom_next_new(x, y, Xblank); cave[x][y+1] = Yalien_stone; next[x][y+1] = Ztank; Lboom_tank_old(x, y+1); @@ -4498,7 +4519,7 @@ static void Lstone_fall(int x, int y) case Xbug_2_s: case Xbug_2_w: cave[x][y] = Ystone_sB; - next[x][y] = Xblank; + Lboom_next_new(x, y, Xblank); cave[x][y+1] = Ybug_stone; next[x][y+1] = Zbug; Lboom_bug_old(x, y+1); @@ -4514,7 +4535,7 @@ static void Lstone_fall(int x, int y) case Xtank_2_s: case Xtank_2_w: cave[x][y] = Ystone_sB; - next[x][y] = Xblank; + Lboom_next_new(x, y, Xblank); cave[x][y+1] = Ytank_stone; next[x][y+1] = Ztank; Lboom_tank_old(x, y+1); @@ -4593,8 +4614,8 @@ static void Lstone_fall(int x, int y) case Xbomb: case Xbomb_pause: - cave[x][y] = Xstone; - next[x][y] = Xstone; + Lboom_cave_new(x, y, Xstone); + Lboom_next_new(x, y, Xstone); cave[x][y+1] = Ybomb_blank; next[x][y+1] = Ztank; Lboom_tank_old(x, y+1);