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. */
#include <string.h>
@ -251,7 +251,7 @@ game_loop ()
if (((bman.players_nr < 2
&& (GT_MP || (GT_SP && bman.ai_players > 0)))
|| (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;
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 */
#include <SDL.h>
@ -318,8 +318,8 @@ stepmove_player (int pl_nr)
else
speed = 1.0f - _pos.y;
if (speed > (p->speed * timefactor) || speed == 0)
speed = p->speed * timefactor;
if (speed > (p->speed) || speed == 0)
speed = p->speed;
// check the new field position
d.x = d.y = 0.0f;
@ -380,7 +380,7 @@ stepmove_player (int pl_nr)
p->pos.x = map.tunnel[tunnelnr].x;
p->pos.y = map.tunnel[tunnelnr].y;
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)
return 0;
return (p->speed - (speed/timefactor));
return (p->speed - speed);
};
@ -421,8 +421,6 @@ move_player (int pl_nr)
float speed, stepsleft;
_player *p = &players[pl_nr];
oldd = p->d;
if (p->tunnelto > 0.0f) {
p->tunnelto -= timediff;
p->m = 0;
@ -431,15 +429,18 @@ move_player (int pl_nr)
}
else {
if (p->m) {
/* prepade playervariables for the moving */
player_animation (p);
if ((stepsleft = stepmove_player (pl_nr)) > 0) {
/* save the speed and go the rest of the step */
oldd = p->d;
speed = p->speed;
stepsleft = speed * timefactor;
do {
p->d = oldd;
speed = p->speed;
p->speed = stepsleft;
stepmove_player (pl_nr);
p->speed = speed;
}
} while ((stepsleft = stepmove_player (pl_nr)) > 0);
/* restore old settings */
p->speed = speed;
/* network packet send control - send data if it's time to send or if we need to */
if (GT_MP)
@ -630,8 +631,10 @@ player_calcpos ()
oldspeed = pl->speed;
oldm = pl->m;
oldd = pl->d;
if (pl->speed > 0.0)
if (pl->speed > 0.0) {
pl->speed *= timefactor;
stepmove_player (p);
}
pl->speed = oldspeed;
}
}
@ -866,8 +869,10 @@ void player_checkdeath (int pnr) {
_player *player = &players[pnr];
int trypos, i;
/* check for respawn */
if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) {
/* respawn only as long as not the game end have reached
* 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 */
d_printf ("Respawn for player %s\n", player->name);
trypos = 0;
@ -888,7 +893,8 @@ void player_checkdeath (int pnr) {
}
/* 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);
player->frame = 0;
player->state &= (0xFF - PSF_respawn);

Loading…
Cancel
Save