|
|
|
@ -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 <SDL.h>
|
|
|
|
@ -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)
|
|
|
|
|
{
|
|
|
|
|
// 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);
|
|
|
|
|
|
|
|
|
|
bman.updatestatusbar = 1; // force an update
|
|
|
|
|