Respawn only when the Hurry mode haven't started

origin
stpohle 22 years ago
parent 69c308b736
commit 540b551355

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.74 2004/01/30 22:32:51 stpohle Exp $ /* $Id: game.c,v 1.75 2004/02/01 00:10:27 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -251,7 +251,7 @@ game_loop ()
if (((bman.players_nr < 2 if (((bman.players_nr < 2
&& (GT_MP || (GT_SP && bman.ai_players > 0))) && (GT_MP || (GT_SP && bman.ai_players > 0)))
|| (GT_SP && bman.ai_players == 0 && bman.players_nr < 1)) || (GT_SP && bman.ai_players == 0 && bman.players_nr < 1))
&& bman.timeout >= 0.0 && bman.gametype == GT_bomberman) && bman.timeout >= 0.0 && (bman.gametype == GT_bomberman || map.state != MS_normal))
bman.timeout = 0.0f; bman.timeout = 0.0f;
if (bman.timeout < -GAME_OVERTIMEOUT) { if (bman.timeout < -GAME_OVERTIMEOUT) {

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.73 2004/01/30 22:32:51 stpohle Exp $ /* $Id: player.c,v 1.74 2004/02/01 00:10:27 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>
@ -318,8 +318,8 @@ stepmove_player (int pl_nr)
else else
speed = 1.0f - _pos.y; speed = 1.0f - _pos.y;
if (speed > (p->speed * timefactor) || speed == 0) if (speed > (p->speed) || speed == 0)
speed = p->speed * timefactor; speed = p->speed;
// check the new field position // check the new field position
d.x = d.y = 0.0f; d.x = d.y = 0.0f;
@ -380,7 +380,7 @@ stepmove_player (int pl_nr)
p->pos.x = map.tunnel[tunnelnr].x; p->pos.x = map.tunnel[tunnelnr].x;
p->pos.y = map.tunnel[tunnelnr].y; p->pos.y = map.tunnel[tunnelnr].y;
p->tunnelto = GAME_TUNNEL_TO; p->tunnelto = GAME_TUNNEL_TO;
speed = p->speed * timefactor; speed = p->speed;
} }
} }
} }
@ -388,7 +388,7 @@ stepmove_player (int pl_nr)
if (d.x == 0.0f && d.y == 0.0f) if (d.x == 0.0f && d.y == 0.0f)
return 0; return 0;
return (p->speed - (speed/timefactor)); return (p->speed - speed);
}; };
@ -421,8 +421,6 @@ move_player (int pl_nr)
float speed, stepsleft; float speed, stepsleft;
_player *p = &players[pl_nr]; _player *p = &players[pl_nr];
oldd = p->d;
if (p->tunnelto > 0.0f) { if (p->tunnelto > 0.0f) {
p->tunnelto -= timediff; p->tunnelto -= timediff;
p->m = 0; p->m = 0;
@ -431,15 +429,18 @@ move_player (int pl_nr)
} }
else { else {
if (p->m) { if (p->m) {
/* prepade playervariables for the moving */
player_animation (p); player_animation (p);
if ((stepsleft = stepmove_player (pl_nr)) > 0) { oldd = p->d;
/* save the speed and go the rest of the step */
p->d = oldd;
speed = p->speed; speed = p->speed;
stepsleft = speed * timefactor;
do {
p->d = oldd;
p->speed = stepsleft; p->speed = stepsleft;
stepmove_player (pl_nr); } while ((stepsleft = stepmove_player (pl_nr)) > 0);
/* restore old settings */
p->speed = speed; p->speed = speed;
}
/* network packet send control - send data if it's time to send or if we need to */ /* network packet send control - send data if it's time to send or if we need to */
if (GT_MP) if (GT_MP)
@ -630,8 +631,10 @@ player_calcpos ()
oldspeed = pl->speed; oldspeed = pl->speed;
oldm = pl->m; oldm = pl->m;
oldd = pl->d; oldd = pl->d;
if (pl->speed > 0.0) if (pl->speed > 0.0) {
pl->speed *= timefactor;
stepmove_player (p); stepmove_player (p);
}
pl->speed = oldspeed; pl->speed = oldspeed;
} }
} }
@ -866,8 +869,10 @@ void player_checkdeath (int pnr) {
_player *player = &players[pnr]; _player *player = &players[pnr];
int trypos, i; int trypos, i;
/* check for respawn */ /* respawn only as long as not the game end have reached
if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) { * and when the gametype is deathmatch mode */
if (map.state == MS_normal && bman.gametype == GT_deathmatch
&& PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) {
/* check new position */ /* check new position */
d_printf ("Respawn for player %s\n", player->name); d_printf ("Respawn for player %s\n", player->name);
trypos = 0; trypos = 0;
@ -888,7 +893,8 @@ void player_checkdeath (int pnr) {
} }
/* check for respawn finish */ /* check for respawn finish */
if (bman.gametype == GT_deathmatch && PS_IS_respawn (player->state) && player->frame >= gfx.respawn.frames) { if (map.state == MS_normal && bman.gametype == GT_deathmatch
&& PS_IS_respawn (player->state) && player->frame >= gfx.respawn.frames) {
d_printf ("Respawn completed for player %s\n", player->name); d_printf ("Respawn completed for player %s\n", player->name);
player->frame = 0; player->frame = 0;
player->state &= (0xFF - PSF_respawn); player->state &= (0xFF - PSF_respawn);

Loading…
Cancel
Save