diff --git a/src/bomb.c b/src/bomb.c index ed4c68b..bee843a 100644 --- a/src/bomb.c +++ b/src/bomb.c @@ -1,4 +1,4 @@ -/* $Id: bomb.c,v 1.45 2003/09/04 21:40:27 stpohle Exp $ */ +/* $Id: bomb.c,v 1.46 2003/09/09 14:12:59 stpohle Exp $ */ /* everything what have to do with the bombs */ #include "bomberclone.h" @@ -82,6 +82,9 @@ bomb_move (_bomb * bomb) int step = 0, dist = 0, keepdir = 0; _point fpos, rpos; + map.bfield[bomb->pos.x>>8][bomb->pos.y>>8] = 0; /* delete bfield */ + stonelist_add (bomb->pos.x>>8, bomb->pos.y>>8); + /* do this once, and again if the direction is still ok */ do { /* get the current position of the bomb */ @@ -128,19 +131,14 @@ bomb_move (_bomb * bomb) d.x = b.x + bomb->dest.x; d.y = b.y + bomb->dest.y; - if (map.bfield[d.x][d.y] == 0 && (map.field[d.x][d.y].type == FT_nothing || map.field[d.x][d.y].type == FT_tunnel)) { + if (map.bfield[d.x][d.y] == 0 && (map.field[d.x][d.y].type == FT_nothing || map.field[d.x][d.y].type == FT_tunnel)) /* this direction is still oky */ - map.bfield[d.x][d.y] = 1; - map.bfield[b.x][b.y] = 0; keepdir = 1; - } else if (bomb->mode == BM_liquid) { /* liquid bomb so move to the other side */ keepdir = 0; bomb->dest.x = -bomb->dest.x; bomb->dest.y = -bomb->dest.y; - map.bfield[b.x+bomb->dest.x][b.y+bomb->dest.y] = 1; - map.bfield[b.x][b.y] = 0; } else { /* stop moving this bomb */ @@ -166,6 +164,9 @@ bomb_move (_bomb * bomb) } dist += step; } while (dist < bomb->speed && (bomb->mode == BM_liquid || bomb->mode == BM_moving) && keepdir); + + map.bfield[bomb->pos.x>>8][bomb->pos.y>>8] = 1; /* set new bfield */ + stonelist_add (bomb->pos.x>>8, bomb->pos.y>>8); } diff --git a/src/packets.c b/src/packets.c index 6e8f994..a9bc3a1 100644 --- a/src/packets.c +++ b/src/packets.c @@ -618,7 +618,7 @@ do_bombdata (struct pkg_bombdata *b_dat, _net_addr * addr) if (bomb->state == BS_off && (b_dat->state == BS_ticking || b_dat->state == BS_trigger)) snd_play (SND_bombdrop); - + bomb->pos.x = b_dat->x; bomb->pos.y = b_dat->y;