Well, always fell bad asking for help or in the past using people snippets.
But I did something today that I thought would be alot harder, but was
pretty easy. And I figured it's something be worth passing on to others.
It's only one small problem is it doesn't change the number of the area. But
it will sort them in vnum order. And I was impressed at how fast it ran, my
vnums where a mess *inno*
But ya here it is, hope it helps someone:
AEDIT(aedit_sort)
{
AREA_DATA *area = NULL, *prev, *temp;
bool moved = FALSE;
if (!IS_IMP(ch))
{
send_to_char("Only an IMP can use this.\n\r", ch);
return FALSE;
}
for (; ;)
{
for (prev = NULL, area = area_first; area != NULL; prev = area, area =
area->next)
{
if (area->next == NULL)
continue;
if (area->next->min_vnum < area->min_vnum)
{
temp = area->next->next;
prev->next = area->next;
prev->next->next = area;
area->next = temp;
moved = TRUE;
}
if (moved)
break;
}
if (area == NULL)
break;
moved = FALSE;
}
send_to_char("Sort complete.\n\r", ch);
return FALSE;
}
p.s. Sorry outlook eats my formating...