|
|
|
@ -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 */
|
|
|
|
|