From 702472a2474ff93fd08e906e3f2c7e15a5021430 Mon Sep 17 00:00:00 2001 From: stpohle Date: Sun, 28 Dec 2003 01:35:35 +0000 Subject: [PATCH] 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 --- src/game.c | 6 +++--- src/map.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game.c b/src/game.c index bf21b7e..e015879 100644 --- a/src/game.c +++ b/src/game.c @@ -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. */ #include @@ -334,8 +334,8 @@ game_start () snd_music_start (); map.state = MS_normal; bman.timeout = bman.init_timeout; - s_calctimesync (); /* to clean up the timesyc - s_calctimesync (); * data run this twice */ + s_calctimesync (); // to clean up the timesyc + s_calctimesync (); // data run this twice }; diff --git a/src/map.c b/src/map.c index 6130b11..a7bcd84 100644 --- a/src/map.c +++ b/src/map.c @@ -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. */ #include "bomberclone.h" @@ -182,8 +182,9 @@ map_set_playerposition (int usermap) while (p == 50) { p = 0; dist--; - for (i = 0; (p < 50 && i < MAX_PLAYERS);) { - if (usermap) { + for (i = 0; (p < 50 && i < MAX_PLAYERS);) + if (PS_IS_playing (players[i].state)) + { int maxloop = 0; while (maxloop < 200 && (PLX == -1 || PLY == -1)) { maxloop++; @@ -211,7 +212,7 @@ map_set_playerposition (int usermap) if (dy == 0) 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) || map.field[(int)PLX + dx][(int)PLY].type == FT_nothing)) dx = -dx; @@ -240,7 +241,6 @@ map_set_playerposition (int usermap) if (map.field[(int)PLX][(int)PLY + dy].type != FT_tunnel) map.field[(int)PLX][(int)PLY + dy].type = FT_nothing; } - } } if (PLX < 0 || PLY < 0) { /* we could not set all fields or we don't run on a usermap */