diff --git a/src/bomb.c b/src/bomb.c index 8d69f7a..906fae4 100644 --- a/src/bomb.c +++ b/src/bomb.c @@ -230,6 +230,9 @@ restore_explosion (_bomb * bomb) gfx.offset.y + (_y-bomb->firer[up]) * gfx.block.y, gfx.block.x*(bomb->firer[left]+bomb->firer[right]+1), gfx.block.x*(bomb->firer[up]+bomb->firer[down]+1)); + + /* delete field from the bfield map */ + bman.bfield [bomb->pos.x][bomb->pos.y] = 0; }; diff --git a/src/bomberclone.h b/src/bomberclone.h index 8cec485..faf6f57 100644 --- a/src/bomberclone.h +++ b/src/bomberclone.h @@ -1,4 +1,4 @@ -/* $Id: bomberclone.h,v 1.20 2003/05/11 17:27:30 stpohle Exp $ */ +/* $Id: bomberclone.h,v 1.21 2003/05/11 22:28:14 stpohle Exp $ */ /* bomberclone.h */ #ifndef _BOMBERCLONE_H_ @@ -124,6 +124,7 @@ struct __bomberclone { int p_nr; // Playernumber 0 if you host a game or the number of the one you are. _field field[MAX_FIELDSIZE_X][MAX_FIELDSIZE_Y]; + unsigned char bfield[MAX_FIELDSIZE_X][MAX_FIELDSIZE_Y]; // will hold informations if ther is a bomb int random_map; // random selecting of a map char fieldpath[512]; // path of the field file @@ -182,7 +183,7 @@ extern void draw_player (_player * player); extern void restore_players_screen (); extern void move_player (); extern int stepmove_player (); -extern void player_drop_bomb (); +extern void player_drop_bomb (int pl_nr); extern void get_player_on (short int x, short int y, int pl_nr[]); extern void player_died (_player * player, signed char dead_by); extern void draw_players (); diff --git a/src/field.c b/src/field.c index c9ca49c..2ea76cb 100644 --- a/src/field.c +++ b/src/field.c @@ -1,4 +1,4 @@ -/* $Id: field.c,v 1.17 2003/05/11 03:27:18 patty21 Exp $ */ +/* $Id: field.c,v 1.18 2003/05/11 22:29:28 stpohle Exp $ */ /* field.c - procedures which are needed to control the field */ #include @@ -328,6 +328,11 @@ field_new (char *filename) } } + /* delete the bfield data */ + for (x = 0; x < MAX_FIELDSIZE_X; x++) + for (y = 0; y < MAX_FIELDSIZE_Y; y++) + bman.bfield[x][y] = 0; + /* Set the Playerinformation */ field_set_playerposition (fmap != NULL); diff --git a/src/game.c b/src/game.c index aea0762..4b8d97f 100644 --- a/src/game.c +++ b/src/game.c @@ -168,7 +168,7 @@ game_loop () } if (keys[SDLK_LCTRL] || keys[SDLK_RCTRL]) { if (key_bomb == 0) - player_drop_bomb (); + player_drop_bomb (bman.p_nr); key_bomb = 1; } else diff --git a/src/packets.c b/src/packets.c index 54c0d6b..1fb30e5 100644 --- a/src/packets.c +++ b/src/packets.c @@ -593,6 +593,8 @@ do_bombdata (struct pkg_bombdata *b_dat, _net_addr * addr) bomb->pos.y = b_dat->y; if (bomb->state != BS_ticking) bomb->to = b_dat->to; + else + bman.bfield[bomb->pos.x][bomb->pos.y] = 1; // keep the bfield up to date bomb->r = b_dat->r; bomb->ex_nr = b_dat->ex_nr; bomb->state = b_dat->state; @@ -601,6 +603,7 @@ do_bombdata (struct pkg_bombdata *b_dat, _net_addr * addr) if (bomb->ex_nr > bman.last_ex_nr) bman.last_ex_nr = bomb->ex_nr; + }; diff --git a/src/player.c b/src/player.c index f8afa37..4e1f64a 100644 --- a/src/player.c +++ b/src/player.c @@ -315,9 +315,9 @@ move_player () void -player_drop_bomb () +player_drop_bomb (int pl_nr) { - _player *player = &bman.players[bman.p_nr]; + _player *player = &bman.players[pl_nr]; _bomb *bomb = NULL; int i, _x, @@ -361,7 +361,7 @@ player_drop_bomb () bomb->to = BOMB_TIMEOUT * TIME_FACTOR; // 5 Secs * 200 if (bman.gametype != GT_single) { - net_game_send_bomb (bman.p_nr, i); + net_game_send_bomb (pl_nr, i); if (GT_MP_PTPS) bomb->to = bomb->to + ((2 * RESENDCACHE_RETRY) / TIME_FACTOR); } @@ -608,7 +608,7 @@ player_ilness_loop (int pl_nr) } else if (type == PI_bomb) /* player is dropping bombs */ - player_drop_bomb (); + player_drop_bomb (bman.p_nr); } } }