/* Clear, generate and display the map */ void draw_map( CHAR_DATA *ch, char *desc ) { int x, y; static char buf[MAX_STRING_LENGTH]; xprintf( buf, desc ); /* Remove undesirable characters */ reformat_desc( buf ); /* Clear map */ for( y = 0; y <= MAPY; y++ ) { for( x = 0; x <= MAPX; x++ ) { clear_coord( x, y ); } } /* Start with players pos at centre of map */ x = MAPX / 2; y = MAPY / 2; map[x][y].vnum = ch->in_room->vnum; map[x][y].depth = 0; /* Generate the map */ map_exits( ch, ch->in_room, x, y, 0 ); /* Current position should be a "X" */ map[x][y].tegn = 'X'; /* Send the map */ show_map( ch, buf ); }
/* Clear, generate and display the map */ void draw_room_map( CHAR_DATA * ch, const char *desc ) { int x, y; static char buf[MAX_STRING_LENGTH]; mudstrlcpy( buf, desc, MAX_STRING_LENGTH ); /* * Remove undesirable characters */ reformat_desc( buf ); /* * Clear map */ for ( y = 0; y <= MAPY; ++y ) { for ( x = 0; x <= MAPX; ++x ) { clear_coord( x, y ); } } /* * Start with players pos at centre of map */ x = MAPX / 2; y = MAPY / 2; dmap[x][y].vnum = ch->in_room->vnum; dmap[x][y].depth = 0; /* * Generate the map */ map_exits( ch, ch->in_room, x, y, 0 ); /* * Current position should be a "X" */ dmap[x][y].tegn = '@'; dmap[x][y].sector = -1; /* * Send the map */ show_map( ch, buf ); }