|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: map.c,v 1.16 2003/12/28 04:51:25 stpohle Exp $ */
|
|
|
|
/* $Id: map.c,v 1.17 2003/12/28 19:07:38 stpohle Exp $ */
|
|
|
|
/* map handling, like generate and load maps. */
|
|
|
|
/* map handling, like generate and load maps. */
|
|
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
@ -198,8 +198,6 @@ map_set_player_way1 (int pl)
|
|
|
|
p.x = s_random (map.size.x - 2) + 1;
|
|
|
|
p.x = s_random (map.size.x - 2) + 1;
|
|
|
|
p.y = s_random (map.size.y - 2) + 1;
|
|
|
|
p.y = s_random (map.size.y - 2) + 1;
|
|
|
|
|
|
|
|
|
|
|
|
d_printf ("map_set_player_way2 (%d) : %d,%d\n", pl, p.x, p.y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* check if there is no block */
|
|
|
|
/* check if there is no block */
|
|
|
|
if (map.field[p.x][p.y].type != FT_nothing)
|
|
|
|
if (map.field[p.x][p.y].type != FT_nothing)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -253,8 +251,6 @@ map_set_player_way2 (int pl)
|
|
|
|
p.x = s_random (map.size.x - 2) + 1;
|
|
|
|
p.x = s_random (map.size.x - 2) + 1;
|
|
|
|
p.y = s_random (map.size.y - 2) + 1;
|
|
|
|
p.y = s_random (map.size.y - 2) + 1;
|
|
|
|
|
|
|
|
|
|
|
|
d_printf ("map_set_player_way2 (%d) : %d,%d\n", pl, p.x, p.y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* check if there is no block */
|
|
|
|
/* check if there is no block */
|
|
|
|
if (map.field[p.x][p.y].type != FT_nothing)
|
|
|
|
if (map.field[p.x][p.y].type != FT_nothing)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -358,6 +354,8 @@ map_set_playerposition (int usermap)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (maxtry)
|
|
|
|
if (maxtry)
|
|
|
|
d_fatal ("Not All Player could been set\n");
|
|
|
|
d_fatal ("Not All Player could been set\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d_printf ("map_set_playerposition\n");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#undef PLX
|
|
|
|
#undef PLX
|
|
|
@ -399,6 +397,7 @@ map_random ()
|
|
|
|
void
|
|
|
|
void
|
|
|
|
init_map_tileset ()
|
|
|
|
init_map_tileset ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (GT_MP_PTPM || GT_SP) {
|
|
|
|
switch (map.map_selection) {
|
|
|
|
switch (map.map_selection) {
|
|
|
|
case (0):
|
|
|
|
case (0):
|
|
|
|
map_new (map.map);
|
|
|
|
map_new (map.map);
|
|
|
@ -410,11 +409,12 @@ init_map_tileset ()
|
|
|
|
case (2):
|
|
|
|
case (2):
|
|
|
|
map_new (NULL);
|
|
|
|
map_new (NULL);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (map.random_tileset)
|
|
|
|
if (map.random_tileset)
|
|
|
|
tileset_random ();
|
|
|
|
tileset_random ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* read from an open file map, determine field.x and field.y
|
|
|
|
/* read from an open file map, determine field.x and field.y
|
|
|
@ -490,4 +490,4 @@ map_load (FILE * fmap)
|
|
|
|
map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block;
|
|
|
|
map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block;
|
|
|
|
|
|
|
|
|
|
|
|
fclose (fmap);
|
|
|
|
fclose (fmap);
|
|
|
|
}
|
|
|
|
};
|
|
|
|