Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://50.28.74.132/home/luminari/svn/luminari/myproject/trunk@5278 dda7f814-ccd3-4591-a6d7-1bd23e5e64af
  • Loading branch information
luminari committed Apr 23, 2018
1 parent 75130f9 commit 00f7bb3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion act.informative.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ void look_at_room(struct char_data *ch, int ignore_brief) {
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOMAP) && can_see_map(ch)) {
if (PRF_FLAGGED(ch, PRF_GUI_MODE)) { // GUI mode!
char *mapstr = NULL;
get_map_string(mapstr);
mapstr = get_map_string(ch);
// Send tags, then map.
send_to_char(ch,
"<ROOM_MAP>\n"
Expand Down
24 changes: 22 additions & 2 deletions asciimap.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,29 @@ static char *StringMap(int centre, int size) {
*mp = '\0';
return strmap;
}

/* public function to return a string representation of the map. */
void get_map_string(char *str) {
str = StringMap(MAX_MAP / 2, DEFAULT_MAP_SIZE);
char * get_map_string(struct char_data *ch) {
int size, centre, x, y, min, max
int ew_size = 0, ns_size = 0;
bool worldmap;


worldmap = show_worldmap(ch);

size = CONFIG_MINIMAP_SIZE;
centre = MAX_MAP / 2;
min = centre - 2 * size;
max = centre + 2 * size;

for (x = 0; x < MAX_MAP; ++x)
for (y = 0; y < MAX_MAP; ++y)
map[x][y] = (!(y % 2) && !worldmap) ? DOOR_NONE : SECT_EMPTY;

/* starts the mapping with the center room */
MapArea(target_room, ch, centre, centre, min, max, ns_size / 2, ew_size / 2, worldmap);
map[centre][centre] = SECT_HERE;
return CompactStringMap(centre, size);
}

static char *WorldMap(int centre, int size, int mapshape, int maptype) {
Expand Down
2 changes: 1 addition & 1 deletion asciimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bool show_worldmap(struct char_data *ch);
void perform_map( struct char_data *ch, char *argument, bool worldmap);
bool can_see_map(struct char_data *ch);
void str_and_map(char *str, struct char_data *ch, room_vnum target_room );
void get_map_string(char *str);
char * get_map_string(struct char_data *ch);

ACMD(do_map);

Expand Down

0 comments on commit 00f7bb3

Please sign in to comment.