From 0cc9012e82f3a9054902e53c5c77bc5a2d6576a4 Mon Sep 17 00:00:00 2001 From: stpohle Date: Sun, 8 Feb 2004 01:30:42 +0000 Subject: [PATCH] deleted unneeded stuff --- include/map.h | 4 ++-- src/map.c | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/map.h b/include/map.h index 86d89bf..bfb6dec 100644 --- a/include/map.h +++ b/include/map.h @@ -1,4 +1,4 @@ -/* $Id: map.h,v 1.14 2004/02/08 00:49:14 stpohle Exp $ */ +/* $Id: map.h,v 1.15 2004/02/08 01:34:46 stpohle Exp $ */ /* map.h */ #ifndef _MAP_H_ @@ -86,7 +86,7 @@ extern void map_genrandom (); extern void init_map_tileset(); extern void map_new (char *filename); extern void map_load (FILE * fmap); - +extern void map_set_playerposition (int usermap); /* new functions for player positioning */ extern int map_ensure_corner_start_points(); diff --git a/src/map.c b/src/map.c index e21ca79..9b5215c 100644 --- a/src/map.c +++ b/src/map.c @@ -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. */ #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); + /* Set the Playerinformation */ + map_set_playerposition (fmap != NULL); + /* put the fire powerups in the field */ map_fillitems (FT_fire, map.fire); /* 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 */ void map_random ()