{"exlist", do_exlist, POS_DEAD, L4, LOG_ALWAYS, 1},
DECLARE_DO_FUN( do_exlist ); /* Erwin Anderson's Area exit display utility */
/* opposite directions */
const sh_int opposite_dir [6] = { DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST, DIR_DOWN, DIR_UP };
/* get the 'short' name of an area (e.g. MIDGAARD, MIRROR etc. */
/* assumes that the filename saved in the AREA_DATA struct is something like midgaard.are */
char * area_name (AREA_DATA *pArea)
{
static char buffer[64]; /* short filename */
char *period;
assert (pArea != NULL);
strncpy (buffer, pArea->filename, 64); /* copy the filename */
period = strchr (buffer, '.'); /* find the period (midgaard.are) */
if (period) /* if there was one */
*period = '\0'; /* terminate the string there (midgaard) */
return buffer;
}
typedef enum {exit_from, exit_to, exit_both} exit_status;
/* depending on status print > or < or <> between the 2 rooms */
void room_pair (ROOM_INDEX_DATA* left, ROOM_INDEX_DATA* right, exit_status ex, char *buffer)
{
char *sExit;
switch (ex)
{
default:
sExit = "??"; break; /* invalid usage */
case exit_from:
sExit = "< "; break;
case exit_to:
sExit = " >"; break;
case exit_both:
sExit = "<>"; break;
}
sprintf (buffer, "%5d %-26.26s %s%5d %-26.26s(%-8.8s)\n\r",
left->vnum, left->name,
sExit,
right->vnum, right->name,
area_name(right->area)
);
}
/* for every exit in 'room' which leads to or from pArea but NOT both, print it */
void checkexits (ROOM_INDEX_DATA *room, AREA_DATA *pArea, char* buffer)
{
char buf[MAX_STRING_LENGTH];
int i;
EXIT_DATA *exit;
ROOM_INDEX_DATA *to_room;
strcpy (buffer, "");
for (i = 0; i < 6; i++)
{
exit = room->exit[i];
if (!exit)
continue;
else
to_room = exit->to_room;
if (to_room) /* there is something on the other side */
if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */
if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */
strcat (buffer, buf);
}
else
if ( (room->area != pArea) && (exit->to_room->area == pArea) )
{ /* an exit from another area to our area */
if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}
} /* if room->area */
} /* for */
}
/* for now, no arguments, just list the current area */
void do_exlist (CHAR_DATA *ch, char * argument)
{
AREA_DATA* pArea;
ROOM_INDEX_DATA* room;
int i;
char buffer[MAX_STRING_LENGTH];
pArea = ch->in_room->area; /* this is the area we want info on */
for (i = 0; i < MAX_KEY_HASH; i++) /* room index hash table */
for (room = room_index_hash[i]; room != NULL; room = room->next)
/* run through all the rooms on the MUD */
{
checkexits (room, pArea, buffer);
send_to_char (buffer, ch);
}
}
4846: assert (pArea != NULL);
4848: strncpy (buffer, pArea->filename, 64); /* copy the filename */
4898: to_room = exit->to_room;
4907: to_room->exit[opposite_dir[i]]->to_room == room )
4915: if ( (room->area != pArea) && (exit->to_room->area == pArea) )
4920: to_room->exit[opposite_dir[i]]->to_room == room )
4900: if (to_room) /* there is something on the other side */
change
to_room = exit->to_room;
to
to_room = exit->u1.to_room;
change
to_room->exit[opposite_dir[i]]->to_room == room )
to
to_room->exit[opposite_dir[i]]->u1.to_room == room )
change
if ( (room->area != pArea) && (exit->to_room->area == pArea) )
to
if ( (room->area != pArea) && (exit->u1.to_room->area == pArea) )
change
to_room->exit[opposite_dir[i]]->to_room == room )
to
to_room->exit[opposite_dir[i]]->u1.to_room == room )
updated if statement:
if (to_room) /* there is something on the other side */
{
if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */
if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */
strcat (buffer, buf);
}
else if ( (room->area != pArea) && (exit->to_room->area == pArea) )
{ /* an exit from another area to our area */
if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}
} /* if room->area */
}/*if to_room*/
}/*for*/
/* opposite directions */
const sh_int opposite_dir [6] = { DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST, DIR_DOWN, DIR_UP };
/* get the 'short' name of an area (e.g. MIDGAARD, MIRROR etc. */
/* assumes that the filename saved in the AREA_DATA struct is something like midgaard.are */
char * area_name (AREA_DATA *pArea)
{
static char buffer[64]; /* short filename */
char *period;
assert (pArea != NULL);
/*4849*/ strncpy (buffer, pArea->filename, 64); /* copy the filename */
period = strchr (buffer, '.'); /* find the period (midgaard.are) */
if (period) /* if there was one */
*period = '\0'; /* terminate the string there (midgaard) */
return buffer;
}
typedef enum {exit_from, exit_to, exit_both} exit_status;
/* depending on status print > or < or <> between the 2 rooms */
void room_pair (ROOM_INDEX_DATA* left, ROOM_INDEX_DATA* right, exit_status ex, char *buffer)
{
char *sExit;
switch (ex)
{
default:
sExit = "??"; break; /* invalid usage */
case exit_from:
sExit = "< "; break;
case exit_to:
sExit = " >"; break;
case exit_both:
sExit = "<>"; break;
}
sprintf (buffer, "%5d %-26.26s %s%5d %-26.26s(%-8.8s)\n\r",
left->vnum, left->name,
sExit,
right->vnum, right->name,
area_name(right->area)
);
}
/* for every exit in 'room' which leads to or from pArea but NOT both, print it */
void checkexits (ROOM_INDEX_DATA *room, AREA_DATA *pArea, char* buffer)
{
char buf[MAX_STRING_LENGTH];
int i;
EXIT_DATA *exit;
ROOM_INDEX_DATA *to_room;
strcpy (buffer, "");
for (i = 0; i < 6; i++)
{
exit = room->exit[i];
if (!exit)
continue;
else
to_room = exit->u1.to_room;
if (to_room) /* there is something on the other side */
{
if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */
if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->u1.to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */
strcat (buffer, buf);
}
else
if ( (room->area != pArea) && (exit->u1.to_room->area == pArea) )
{ /* an exit from another area to our area */
if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->u1.to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}
} /* if room->area */
}
} /* for */
}
/* for now, no arguments, just list the current area */
void do_exlist (CHAR_DATA *ch, char * argument)
{
AREA_DATA* pArea;
ROOM_INDEX_DATA* room;
int i;
char buffer[MAX_STRING_LENGTH];
pArea = ch->in_room->area; /* this is the area we want info on */
for (i = 0; i < MAX_KEY_HASH; i++) /* room index hash table */
for (room = room_index_hash[i]; room != NULL; room = room->next)
/* run through all the rooms on the MUD */
{
checkexits (room, pArea, buffer);
send_to_char (buffer, ch);
}
}
/*
* Area definition.
*/
struct area_data
{
AREA_DATA * next;
HELP_AREA * helps;
char * file_name;
char * name;
char * credits;
sh_int age;
sh_int nplayer;
sh_int low_range;
sh_int high_range;
sh_int min_vnum;
sh_int max_vnum;
bool empty;
char * builders; /* OLC */ /* Listing of */
int vnum; /* OLC */ /* Area vnum */
int area_flags; /* OLC */
int security; /* OLC */ /* Value 1-9 */
};
char * filename;
strncpy (buffer, pArea->filename, 64); /* copy the filename */
to
strncpy (buffer, pArea->file_name, 64); /* copy the filename */
char * filename;
strncpy (buffer, pArea->filename, 64); /* copy the filename */
to
strncpy (buffer, pArea->file_name, 64); /* copy the filename */
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
lots and lots, but then it has been compiling alright so I've just left it and carried on as usual.
Today however, I tried removing some areas, and this time I got a bug error and it wouldn't continue to compile.
This is what it said:
Fri Mar 6 20:41:02 2009 :: Loading configuration settings from ../area/qmconfig
.rc.
Fri Mar 6 20:41:02 2009 :: Set IP address to 0.0.0.0
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: [*****] BUG: Fread_word: word too long.
please help.
I have completely stock rom areas except for the immort.are which I haven't removed.