From 1004af6a7d38a2823acc99fd5165d519cb9ff42b Mon Sep 17 00:00:00 2001 From: Fizban Date: Sun, 1 Nov 2009 22:26:00 +0000 Subject: [PATCH] Edited Show Zones and MOB_OR_IMPL macro --- changelog | 2 ++ src/act.wizard.c | 13 +++++++++++-- src/dg_mobcmd.c | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/changelog b/changelog index 0177d32..bd27594 100644 --- a/changelog +++ b/changelog @@ -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. diff --git a/src/act.wizard.c b/src/act.wizard.c index 944ae55..febd061 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -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; diff --git a/src/dg_mobcmd.c b/src/dg_mobcmd.c index bbc8c63..89cab0a 100644 --- a/src/dg_mobcmd.c +++ b/src/dg_mobcmd.c @@ -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 */