On Fri, 4 Oct 1996, Cyanide wrote:
> ACMD(do_tell)
> {
> struct char_data *vict;
>
> half_chop(argument, buf, buf2);
>
> if (!*buf || !*buf2)
> send_to_char("Who do you wish to tell what??\r\n", ch);
> else if (!(vict = get_char_vis(ch, buf)))
> send_to_char(NOPERSON, ch);
> else if (ch == vict)
> send_to_char("You try to tell yourself something.\r\n", ch);
> else if (PRF_FLAGGED(ch, PRF_NOTELL))
> send_to_char("You can't tell other people while you have notell
> on.\r\n", ch);
> else if (ROOM_FLAGGED(ch->in_room, ROOM_SOUNDPROOF))
> send_to_char("The walls seem to absorb your words.\r\n", ch);
> else if (!IS_NPC(vict) && !vict->desc) /* linkless */
> act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
> else if (PLR_FLAGGED(vict, PLR_WRITING))
> act("$E's writing a message right now; try again later.",
> FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
> else if (PRF_FLAGGED(vict, PRF_NOTELL) || ROOM_FLAGGED(vict->in_room,
> ROOM_SOUNDPROOF))
> act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
> else
{
> if (PRF_FLAGGED(ch, PRF_AFK))
> send_to_char("You are away from the keyboard, or are you?\r\n", ch);
> if (PRF_FLAGGED(vict, PRF_AFK))
> {
> act("$E is Away from the keyboard, try again later.",
> FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
> }
> perform_tell(ch, vict, buf2);
}
Basically, since you missed the {, only the first PRF_FLAGGED is run due
to the else, everything after that is considered in the body of the
function and always run, whether or not if found a valid target (or even
argument for that matter)
-George
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://cspo.queensu.ca/~fletcher/Circle/list_faq.html |
+-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST