|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: player.c,v 1.70 2004/01/27 21:58:06 stpohle Exp $
|
|
|
|
/* $Id: player.c,v 1.71 2004/01/27 22:17:22 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>
|
|
|
@ -59,6 +59,8 @@ draw_player (_player * player)
|
|
|
|
else if (PS_IS_respawn (player->state)) {
|
|
|
|
else if (PS_IS_respawn (player->state)) {
|
|
|
|
/* player is respawning
|
|
|
|
/* player is respawning
|
|
|
|
* first: draw the star */
|
|
|
|
* first: draw the star */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf ("Respawn Drawing \n");
|
|
|
|
dest.w = src.w = gfx.respawn.image->w;
|
|
|
|
dest.w = src.w = gfx.respawn.image->w;
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
|
|
|
|
|
|
|
@ -585,26 +587,22 @@ player_animation (_player * player)
|
|
|
|
player->frame += player->gfx->ani.frames;
|
|
|
|
player->frame += player->gfx->ani.frames;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (PS_IS_dead (player->state)) {
|
|
|
|
if (PS_IS_dead (player->state) || PS_IS_respawn (player->state)) {
|
|
|
|
if ((int)player->frame < gfx.dead.frames)
|
|
|
|
if ((int)player->frame < gfx.dead.frames)
|
|
|
|
player->frame += (timefactor * ANI_PLAYERTIMEOUT);
|
|
|
|
player->frame += (timefactor * ANI_PLAYERTIMEOUT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
void
|
|
|
|
dead_playerani ()
|
|
|
|
dead_playerani ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i,
|
|
|
|
int i;
|
|
|
|
b = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
if (PS_IS_dead (players[i].state)) {
|
|
|
|
if (PS_IS_dead (players[i].state) || PS_IS_respawn (players[i].state)) {
|
|
|
|
player_animation (&players[i]);
|
|
|
|
player_animation (&players[i]);
|
|
|
|
b++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -867,6 +865,7 @@ void player_checkdeath (int pnr) {
|
|
|
|
/* check for respawn */
|
|
|
|
/* check for respawn */
|
|
|
|
if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) {
|
|
|
|
if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) {
|
|
|
|
/* check new position */
|
|
|
|
/* check new position */
|
|
|
|
|
|
|
|
printf ("Respawn Test OK\n");
|
|
|
|
trypos = 0;
|
|
|
|
trypos = 0;
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
map_set_player_way1 (pnr);
|
|
|
|
map_set_player_way1 (pnr);
|
|
|
|