Converted areas command to use page_string
This commit is contained in:
@@ -40,7 +40,8 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
|||||||
Bug-Fix: Fixed crash bug introduced by new house system when saving house contents
|
Bug-Fix: Fixed crash bug introduced by new house system when saving house contents
|
||||||
Scan command now tells you when nothing is nearby (thanks Mirad)
|
Scan command now tells you when nothing is nearby (thanks Mirad)
|
||||||
zlist command can now list by builder, like show zones
|
zlist command can now list by builder, like show zones
|
||||||
zlist now uses page_string (thanks Mirad)
|
zlist command now uses page_string (thanks Mirad)
|
||||||
|
areas command now uses page_string (thanks Mirad)
|
||||||
[Dec 02 2010] - Jamdog
|
[Dec 02 2010] - Jamdog
|
||||||
Bug-Fix: identify command in shops was listing incorrect buy price (thanks Kam)
|
Bug-Fix: identify command in shops was listing incorrect buy price (thanks Kam)
|
||||||
Added %actor.admlevel% and %actor.admlevel(<level>)% to dg-scripts
|
Added %actor.admlevel% and %actor.admlevel(<level>)% to dg-scripts
|
||||||
|
|||||||
@@ -2530,8 +2530,8 @@ bool get_zone_levels(zone_rnum znum, char *buf)
|
|||||||
|
|
||||||
ACMD(do_areas)
|
ACMD(do_areas)
|
||||||
{
|
{
|
||||||
int i, hilev=-1, lolev=-1, zcount=0, lev_set;
|
int i, hilev=-1, lolev=-1, zcount=0, lev_set, len=0, tmp_len=0;
|
||||||
char arg[MAX_INPUT_LENGTH], *second, lev_str[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH], *second, lev_str[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
|
||||||
bool show_zone = FALSE, overlap = FALSE, overlap_shown = FALSE;
|
bool show_zone = FALSE, overlap = FALSE, overlap_shown = FALSE;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
@@ -2565,11 +2565,11 @@ ACMD(do_areas)
|
|||||||
hilev = i;
|
hilev = i;
|
||||||
}
|
}
|
||||||
if (hilev != -1)
|
if (hilev != -1)
|
||||||
send_to_char(ch, "Checking range: %s%d to %d%s\r\n", QYEL, lolev, hilev, QNRM);
|
len = snprintf(buf, sizeof(buf), "Checking range: %s%d to %d%s\r\n", QYEL, lolev, hilev, QNRM);
|
||||||
else if (lolev != -1)
|
else if (lolev != -1)
|
||||||
send_to_char(ch, "Checking level: %s%d%s\r\n", QYEL, lolev, QNRM);
|
len = snprintf(buf, sizeof(buf), "Checking level: %s%d%s\r\n", QYEL, lolev, QNRM);
|
||||||
else
|
else
|
||||||
send_to_char(ch, "Checking all areas.\r\n");
|
len = snprintf(buf, sizeof(buf), "Checking all areas.\r\n");
|
||||||
|
|
||||||
for (i = 0; i <= top_of_zone_table; i++) { /* Go through the whole zone table */
|
for (i = 0; i <= top_of_zone_table; i++) { /* Go through the whole zone table */
|
||||||
show_zone = FALSE;
|
show_zone = FALSE;
|
||||||
@@ -2602,15 +2602,24 @@ ACMD(do_areas)
|
|||||||
if (show_zone) {
|
if (show_zone) {
|
||||||
if (overlap) overlap_shown = TRUE;
|
if (overlap) overlap_shown = TRUE;
|
||||||
lev_set = get_zone_levels(i, lev_str);
|
lev_set = get_zone_levels(i, lev_str);
|
||||||
send_to_char(ch, "@n(%3d) %s%-*s@n %s%s@n\r\n", ++zcount, overlap ? QRED : QCYN,
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "@n(%3d) %s%-*s@n %s%s@n\r\n", ++zcount, overlap ? QRED : QCYN,
|
||||||
count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
||||||
lev_set ? "@c" : "@n", lev_set ? lev_str : "All Levels");
|
lev_set ? "@c" : "@n", lev_set ? lev_str : "All Levels");
|
||||||
|
len += tmp_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
send_to_char(ch, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM, zcount == 1 ? "" : "s");
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM, zcount == 1 ? "" : "s");
|
||||||
|
len += tmp_len;
|
||||||
|
|
||||||
if (overlap_shown)
|
if (overlap_shown) {
|
||||||
send_to_char(ch, "Areas shown in @rred@n may have some creatures outside the specified range.\r\n");
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "Areas shown in @rred@n may have some creatures outside the specified range.\r\n");
|
||||||
|
len += tmp_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zcount == 0)
|
||||||
|
send_to_char(ch, "No areas found.\r\n");
|
||||||
|
else
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_scanned_chars(struct char_data * list, struct char_data * ch, int
|
void list_scanned_chars(struct char_data * list, struct char_data * ch, int
|
||||||
|
|||||||
@@ -441,14 +441,13 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon
|
|||||||
|
|
||||||
for (i = 0; i <= top_of_zone_table; i++) {
|
for (i = 0; i <= top_of_zone_table; i++) {
|
||||||
if (zone_table[i].number >= bottom && zone_table[i].number <= top) {
|
if (zone_table[i].number >= bottom && zone_table[i].number <= top) {
|
||||||
tmp_len = 0;
|
|
||||||
if ((!use_name) || (is_name(name, zone_table[i].builders))) {
|
if ((!use_name) || (is_name(name, zone_table[i].builders))) {
|
||||||
tmp_len = snprintf(buf+len, sizeof(buf)-len, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
|
||||||
QGRN, zone_table[i].number, QNRM, QCYN, count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
QGRN, zone_table[i].number, QNRM, QCYN, count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
||||||
QYEL, zone_table[i].builders ? zone_table[i].builders : "None.", QNRM);
|
QYEL, zone_table[i].builders ? zone_table[i].builders : "None.", QNRM);
|
||||||
|
len += tmp_len;
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
len += tmp_len;
|
|
||||||
counter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user