debugging irix problem

fixing network player dead on server
origin
stpohle 21 years ago
parent c0a6007d9a
commit a12f0960b0

@ -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 * playerinclude file
*/ */
@ -132,7 +132,7 @@ extern void player_move (int pl_nr);
extern float stepmove_player (int pl_nr); extern float stepmove_player (int pl_nr);
extern void player_drop_bomb (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 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 draw_players ();
extern void player_animation (_player * player); extern void player_animation (_player * player);
extern int check_field (short int x, short int y); extern int check_field (short int x, short int y);

@ -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 */ /* everything what have to do with the bombs */
#include "bomberclone.h" #include "bomberclone.h"
@ -523,7 +523,7 @@ int explosion_check_field (int x, int y, _bomb *bomb)
&& (GT_SP && (GT_SP
|| (GT_MP && (&players[bman.p_nr] == tmpplayer || (IS_LPLAYER2 && &players[bman.p2_nr] == tmpplayer))) || (GT_MP && (&players[bman.p_nr] == tmpplayer || (IS_LPLAYER2 && &players[bman.p2_nr] == tmpplayer)))
|| (GT_MP_PTPM && PS_IS_aiplayer (tmpplayer->state)))) || (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 // let the stones right beside explode

@ -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) 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++; teams[players[p_dat->dead_by].team_nr].points++;
net_game_send_player (p_dat->dead_by); net_game_send_player (p_dat->dead_by);
player_died (pl, p_dat->dead_by, 1);
} }
} }
pl->state = p_dat->state; pl->state = p_dat->state;

@ -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 */ * player.c - everything what have to do with the player */
#include <SDL.h> #include <SDL.h>
@ -458,15 +458,15 @@ player_move (int pl_nr)
/* check the players position */ /* check the players position */
if (PS_IS_alife (p->state) && (CUTINT(p->pos.x) > EXPLOSION_SAVE_DISTANCE && (p->d == left || p->d == right)) 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))) && (!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)) 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))) && (!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)) 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) || (CUTINT(p->pos.y) < (1.0f - EXPLOSION_SAVE_DISTANCE)
&& (p->d == up || p->d == down))) && (p->d == up || p->d == down)))
&& (!check_exfield (p->pos.x, p->pos.y))) && (!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 void
player_died (_player * player, signed char dead_by) player_died (_player * player, signed char dead_by, int network)
{ {
// player die ! if (PS_IS_netplayer (player->state) && network == 0)
return;
// player die !
d_printf ("player_died (%10s) current state: %d\n", player->name, player->state); d_printf ("player_died (%10s) current state: %d\n", player->name, player->state);
bman.updatestatusbar = 1; // force an update bman.updatestatusbar = 1; // force an update

Loading…
Cancel
Save