|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: map.c,v 1.22 2004/02/08 00:40:20 stpohle Exp $ */
|
|
|
|
/* $Id: map.c,v 1.23 2004/02/08 01:30:42 stpohle Exp $ */
|
|
|
|
/* map handling, like generate and load maps. */
|
|
|
|
/* map handling, like generate and load maps. */
|
|
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
@ -128,6 +128,9 @@ map_new (char *filename)
|
|
|
|
|
|
|
|
|
|
|
|
map_find_and_add_start_points(pl_cnt - map_num_defined_start_points(), MAP_POSITION_TOLERENCE);
|
|
|
|
map_find_and_add_start_points(pl_cnt - map_num_defined_start_points(), MAP_POSITION_TOLERENCE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Set the Playerinformation */
|
|
|
|
|
|
|
|
map_set_playerposition (fmap != NULL);
|
|
|
|
|
|
|
|
|
|
|
|
/* put the fire powerups in the field */
|
|
|
|
/* put the fire powerups in the field */
|
|
|
|
map_fillitems (FT_fire, map.fire);
|
|
|
|
map_fillitems (FT_fire, map.fire);
|
|
|
|
/* put the bomb powerups in the field */
|
|
|
|
/* put the bomb powerups in the field */
|
|
|
@ -194,6 +197,26 @@ map_genrandom ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* will set the playerposition but in a way that we won't start on a block */
|
|
|
|
|
|
|
|
/* i am just too lazy to write this all again and again */
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
map_set_playerposition (int usermap)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int pl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d_printf ("map_set_playerposition\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* This is the new code that will set every player in a starting point
|
|
|
|
|
|
|
|
* It should never fail, but if it does, it will fall through to the old method
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (pl = 0; pl < MAX_PLAYERS; pl++) {
|
|
|
|
|
|
|
|
if (PS_IS_used(players[pl].state)) {
|
|
|
|
|
|
|
|
map_place_player(pl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* load a random map */
|
|
|
|
/* load a random map */
|
|
|
|
void
|
|
|
|
void
|
|
|
|
map_random ()
|
|
|
|
map_random ()
|
|
|
|