Re: [NEWBIE] SPELL_ARMOR

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 07/11/01


On Wed, 11 Jul 2001, Luca wrote:

> if (IS_AFFECTED(ch, AFF_ARMADURA_MENOR))
>   send_to_char("You are protected by another arcane power.\r\n", buf);
>   return;

First, you probably want to enclose the send_to_char() and return
statements in a block -- I'm assuming, of course, that you mean both to be
the body of the if statement.  The compiler can't "figure out" what you
mean, it only knows what you tell it you mean.  So, if I'm right in my
assumption you want to do

  if (AFF_FLAGGED(ch, AFF_ARMADURA_MENOR)) {
    . . .
  }

Second, you have

  send_to_char("You are protected by another arcane power.\r\n", buf);

Now, it's not impossible, of course, but I strongly doubt that 'buf' is a
pointer to a character.  You probably want something like

  if (AFF_FLAGGED(victim, AFF_ARMADURA_MENOR)) {
    act("$E is protected by another arcane power.", FALSE, ch, 0, victim,
        TO_CHAR);
    return;
  }

At the absolute minimum, you should replace buf with ch in your original
and do:

  send_to_char("You are protected by another arcane power.\r\n", ch);

Note that I've replaced your use of the IS_AFFECTED macro with the
AFF_FLAGGED macro.  IS_AFFECTED exists only for backwards compatability.
You should probably use the CircleMUD 3.x style xxx_FLAGGED macros.


-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST