From 76d1d895974e0866db156ff1ebb48955db57cbc1 Mon Sep 17 00:00:00 2001 From: Rumble Date: Fri, 11 May 2007 01:16:30 +0000 Subject: [PATCH] Added numerous NPC checks to PRF checks and fixed nogos/nowiz in who. --Rumble --- src/act.comm.c | 14 +++++++------- src/act.informative.c | 6 +++--- src/act.wizard.c | 2 +- src/comm.c | 2 +- src/db.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/act.comm.c b/src/act.comm.c index e552772..485aa3c 100644 --- a/src/act.comm.c +++ b/src/act.comm.c @@ -99,7 +99,7 @@ ACMD(do_gsay) if (AFF_FLAGGED(f->follower, AFF_GROUP) && (f->follower != ch)) act(buf, FALSE, ch, 0, f->follower, TO_VICT | TO_SLEEP); - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else send_to_char(ch, "You tell the group, '%s@n'\r\n", argument); @@ -263,7 +263,7 @@ ACMD(do_spec_comm) snprintf(buf1, sizeof(buf1), "$n %s you, '%s'", action_plur, buf2); act(buf1, FALSE, ch, 0, vict, TO_VICT); - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if ((!IS_NPC(ch)) && (PRF_FLAGGED(ch, PRF_NOREPEAT))) send_to_char(ch, "%s", CONFIG_OK); else send_to_char(ch, "You %s %s, '%s'\r\n", action_sing, GET_NAME(vict), buf2); @@ -375,7 +375,7 @@ ACMD(do_page) } if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD)) != NULL) { act(buf, FALSE, ch, 0, vict, TO_VICT); - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else act(buf, FALSE, ch, 0, vict, TO_CHAR); @@ -502,7 +502,7 @@ ACMD(do_gen_comm) strlcpy(color_on, com_msgs[subcmd][3], sizeof(color_on)); /* first, set up strings to be given to the communicator */ - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else { snprintf(buf1, sizeof(buf1), "%sYou %s, '%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", com_msgs[subcmd][1], argument, CCNRM(ch, C_CMP)); @@ -516,10 +516,10 @@ ACMD(do_gen_comm) for (i = descriptor_list; i; i = i->next) { if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character ) continue; - if(PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)) + if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING))) continue; - if(ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)) + if (ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)) continue; if (subcmd == SCMD_SHOUT && @@ -547,7 +547,7 @@ ACMD(do_qcomm) char buf[MAX_STRING_LENGTH]; struct descriptor_data *i; - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else if (subcmd == SCMD_QSAY) { snprintf(buf, sizeof(buf), "You quest-say, '%s'", argument); diff --git a/src/act.informative.c b/src/act.informative.c index ec2bf25..d34b712 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -456,7 +456,7 @@ ACMD(do_exits) len++; - if (PRF_FLAGGED(ch, PRF_SHOWVNUMS)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) send_to_char(ch, "%-5s - [%5d] %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room), world[EXIT(ch, door)->to_room].name); else @@ -1280,9 +1280,9 @@ ACMD(do_who) send_to_char(ch, " (Buildwalking)"); if (PRF_FLAGGED(tch, PRF_AFK)) send_to_char(ch, " (AFK)"); - if (PRF_FLAGGED(ch, PRF_NOGOSS)) + if (PRF_FLAGGED(tch, PRF_NOGOSS)) send_to_char(ch, " (nogos)"); - if (PRF_FLAGGED(ch, PRF_NOWIZ)) + if (PRF_FLAGGED(tch, PRF_NOWIZ)) send_to_char(ch, " (nowiz)"); if (PRF_FLAGGED(tch, PRF_NOSHOUT)) send_to_char(ch, " (noshout)"); diff --git a/src/act.wizard.c b/src/act.wizard.c index 21b1d61..a8db955 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -191,7 +191,7 @@ ACMD(do_send) send_to_char(vict, "%s\r\n", buf); mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s sent %s: %s", GET_NAME(ch), GET_NAME(vict), buf); - if (PRF_FLAGGED(ch, PRF_NOREPEAT)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "Sent.\r\n"); else send_to_char(ch, "You send '%s' to %s.\r\n", buf, GET_NAME(vict)); diff --git a/src/comm.c b/src/comm.c index cb68802..38ae8ef 100644 --- a/src/comm.c +++ b/src/comm.c @@ -2573,7 +2573,7 @@ char *act(const char *str, int hide_invisible, struct char_data *ch, char buf[MAX_STRING_LENGTH]; for (i = descriptor_list; i; i = i->next) { - if (!i->connected && i->character && + if (!IS_NPC(i->character) && !i->connected && i->character && !PRF_FLAGGED(i->character, PRF_NOGOSS) && !PLR_FLAGGED(i->character, PLR_WRITING) && !ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF)) { diff --git a/src/db.c b/src/db.c index 376f86f..718f041 100644 --- a/src/db.c +++ b/src/db.c @@ -2568,7 +2568,7 @@ int is_empty(zone_rnum zone_nr) continue; /* If an immortal has nohassle off, he counts as present. Added for testing * zone reset triggers -Welcor */ - if ((GET_LEVEL(i->character) >= LVL_IMMORT) && (PRF_FLAGGED(i->character, PRF_NOHASSLE))) + if ((!IS_NPC(i->character)) && (GET_LEVEL(i->character) >= LVL_IMMORT) && (PRF_FLAGGED(i->character, PRF_NOHASSLE))) continue; return (0);