Edited Show Zones and MOB_OR_IMPL macro

This commit is contained in:
Fizban 2009-11-01 22:26:00 +00:00
parent 47c79784c2
commit 1004af6a7d
3 changed files with 14 additions and 3 deletions

View file

@ -36,6 +36,8 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too)
@
tbaMUD 3.61
[Nov 01 2009] - Fizban
Changed MOB_OR_IMPL macro to allow player-attachable scripts to work properly and edited the output of 'show zones'.
[Oct 27 2009] - Rumble
Added zone 555/556 qst files.
PLR_BUG/IDEA/TYPO flag cleanup.

View file

@ -2419,7 +2419,7 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l
ACMD(do_show)
{
int i, j, k, l, con; /* i, j, k to specifics? */
int i, j, k, l, con, builder =0; /* i, j, k to specifics? */
size_t len, nlen;
zone_rnum zrn;
zone_vnum zvn;
@ -2489,11 +2489,16 @@ ACMD(do_show)
}
} else {
char *buf2;
if (*value)
builder = 1;
for (len = zrn = 0; zrn <= top_of_zone_table; zrn++) {
if (*value) {
buf2 = strtok(strdup(zone_table[zrn].builders), " ");
while (buf2) {
if (!str_cmp(buf2, value))
if (!str_cmp(buf2, value)) {
if (builder == 1)
builder++;
}
break;
buf2 = strtok(NULL, " ");
}
@ -2506,6 +2511,10 @@ ACMD(do_show)
len += nlen;
}
}
if (builder == 1)
send_to_char(ch, "%s has not built any zones here.\r\n", CAP(value));
else if (builder == 2)
send_to_char(ch, "The following zones have been built by: %s\r\n", CAP(value));
page_string(ch->desc, buf, TRUE);
break;

View file

@ -44,7 +44,7 @@ static void mob_log(char_data *mob, const char *format, ...)
/* Macro to determine if a mob is permitted to use these commands. */
#define MOB_OR_IMPL(ch) \
(IS_NPC(ch) && (!(ch)->desc || GET_LEVEL((ch)->desc->original)>=LVL_IMPL))
((IS_NPC(ch) && (!(ch)->desc || GET_LEVEL((ch)->desc->original) >= LVL_IMPL)) || (SCRIPT(ch) && TRIGGERS(SCRIPT(ch))))
#define MOB_OR_PLAYER(ch) (GET_LEVEL(ch) > 0)
/* mob commands */