diff --git a/include/player.h b/include/player.h index 6ee3f1d..a073160 100644 --- a/include/player.h +++ b/include/player.h @@ -1,4 +1,4 @@ -/* $Id: player.h,v 1.9 2004/10/18 20:20:22 stpohle Exp $ +/* $Id: player.h,v 1.10 2005/02/20 19:11:20 stpohle Exp $ * playerinclude file */ @@ -132,7 +132,7 @@ extern void player_move (int pl_nr); extern float stepmove_player (int pl_nr); extern void player_drop_bomb (int pl_nr); extern void get_player_on (float x, float y, int pl_nr[]); -extern void player_died (_player * player, signed char dead_by); +extern void player_died (_player * player, signed char dead_by, int network); extern void draw_players (); extern void player_animation (_player * player); extern int check_field (short int x, short int y); diff --git a/src/bomb.c b/src/bomb.c index 47a879a..77a570a 100644 --- a/src/bomb.c +++ b/src/bomb.c @@ -1,4 +1,4 @@ -/* $Id: bomb.c,v 1.61 2004/12/01 02:41:54 stpohle Exp $ */ +/* $Id: bomb.c,v 1.62 2005/02/20 19:11:20 stpohle Exp $ */ /* everything what have to do with the bombs */ #include "bomberclone.h" @@ -523,7 +523,7 @@ int explosion_check_field (int x, int y, _bomb *bomb) && (GT_SP || (GT_MP && (&players[bman.p_nr] == tmpplayer || (IS_LPLAYER2 && &players[bman.p2_nr] == tmpplayer))) || (GT_MP_PTPM && PS_IS_aiplayer (tmpplayer->state)))) - player_died (tmpplayer, bomb->id.p); + player_died (tmpplayer, bomb->id.p, 0); } // let the stones right beside explode diff --git a/src/packets.c b/src/packets.c index ad6d951..7da1290 100644 --- a/src/packets.c +++ b/src/packets.c @@ -828,6 +828,7 @@ do_playerdata (struct pkg_playerdata *p_dat, _net_addr * addr) if (bman.gametype == GT_team && players[p_dat->dead_by].team_nr >= 0 && players[p_dat->dead_by].team_nr < MAX_TEAMS) teams[players[p_dat->dead_by].team_nr].points++; net_game_send_player (p_dat->dead_by); + player_died (pl, p_dat->dead_by, 1); } } pl->state = p_dat->state; diff --git a/src/player.c b/src/player.c index 92588e9..ef555e7 100644 --- a/src/player.c +++ b/src/player.c @@ -1,4 +1,4 @@ -/* $Id: player.c,v 1.97 2004/12/26 04:19:20 stpohle Exp $ +/* $Id: player.c,v 1.98 2005/02/20 19:11:21 stpohle Exp $ * player.c - everything what have to do with the player */ #include @@ -458,15 +458,15 @@ player_move (int pl_nr) /* check the players position */ if (PS_IS_alife (p->state) && (CUTINT(p->pos.x) > EXPLOSION_SAVE_DISTANCE && (p->d == left || p->d == right)) && (!check_exfield (p->pos.x + 1.0f, p->pos.y))) - player_died (p, -1); + player_died (p, -1, 0); if (PS_IS_alife (p->state) && (CUTINT(p->pos.y) > EXPLOSION_SAVE_DISTANCE && (p->d == up || p->d == down)) && (!check_exfield (p->pos.x, p->pos.y + 1.0f))) - player_died (p, -1); + player_died (p, -1, 0); if (PS_IS_alife (p->state) && ((CUTINT(p->pos.x) < (1.0f - EXPLOSION_SAVE_DISTANCE) && (p->d == left || p->d == right)) || (CUTINT(p->pos.y) < (1.0f - EXPLOSION_SAVE_DISTANCE) && (p->d == up || p->d == down))) && (!check_exfield (p->pos.x, p->pos.y))) - player_died (p, -1); + player_died (p, -1, 0); } }; @@ -538,11 +538,16 @@ get_player_on (float x, float y, int pl_nr[]) }; +/* + * check if we control this player, and let it die. + */ void -player_died (_player * player, signed char dead_by) +player_died (_player * player, signed char dead_by, int network) { + if (PS_IS_netplayer (player->state) && network == 0) + return; + // player die ! - d_printf ("player_died (%10s) current state: %d\n", player->name, player->state); bman.updatestatusbar = 1; // force an update