player start fixed.. not all players have been set right..

maybe i need to rewrite the code to setting the
players on the field soon
origin
stpohle 22 years ago
parent 27726ec2a3
commit 702472a247

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.62 2003/12/28 01:21:43 stpohle Exp $ /* $Id: game.c,v 1.63 2003/12/28 01:35:35 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -334,8 +334,8 @@ game_start ()
snd_music_start (); snd_music_start ();
map.state = MS_normal; map.state = MS_normal;
bman.timeout = bman.init_timeout; bman.timeout = bman.init_timeout;
s_calctimesync (); /* to clean up the timesyc s_calctimesync (); // to clean up the timesyc
s_calctimesync (); * data run this twice */ s_calctimesync (); // data run this twice
}; };

@ -1,4 +1,4 @@
/* $Id: map.c,v 1.14 2003/12/24 02:38:15 stpohle Exp $ */ /* $Id: map.c,v 1.15 2003/12/28 01:35:35 stpohle Exp $ */
/* map handling, like generate and load maps. */ /* map handling, like generate and load maps. */
#include "bomberclone.h" #include "bomberclone.h"
@ -182,8 +182,9 @@ map_set_playerposition (int usermap)
while (p == 50) { while (p == 50) {
p = 0; p = 0;
dist--; dist--;
for (i = 0; (p < 50 && i < MAX_PLAYERS);) { for (i = 0; (p < 50 && i < MAX_PLAYERS);)
if (usermap) { if (PS_IS_playing (players[i].state))
{
int maxloop = 0; int maxloop = 0;
while (maxloop < 200 && (PLX == -1 || PLY == -1)) { while (maxloop < 200 && (PLX == -1 || PLY == -1)) {
maxloop++; maxloop++;
@ -211,7 +212,7 @@ map_set_playerposition (int usermap)
if (dy == 0) if (dy == 0)
dy = -1; dy = -1;
/* first check if there is and free place for us */ /* first check if there is a free place for us */
if (!((map.field[(int)PLX + dx][(int)PLY].type != FT_block && maxloop > 100) || if (!((map.field[(int)PLX + dx][(int)PLY].type != FT_block && maxloop > 100) ||
map.field[(int)PLX + dx][(int)PLY].type == FT_nothing)) map.field[(int)PLX + dx][(int)PLY].type == FT_nothing))
dx = -dx; dx = -dx;
@ -240,7 +241,6 @@ map_set_playerposition (int usermap)
if (map.field[(int)PLX][(int)PLY + dy].type != FT_tunnel) if (map.field[(int)PLX][(int)PLY + dy].type != FT_tunnel)
map.field[(int)PLX][(int)PLY + dy].type = FT_nothing; map.field[(int)PLX][(int)PLY + dy].type = FT_nothing;
} }
}
} }
if (PLX < 0 || PLY < 0) { if (PLX < 0 || PLY < 0) {
/* we could not set all fields or we don't run on a usermap */ /* we could not set all fields or we don't run on a usermap */

Loading…
Cancel
Save