Mount question (was: Re: RE: Backstab.)

From: Daniel Koepke (dkoepke@california.com)
Date: 02/04/97


On Wed, 5 Feb 1997, DJ Pure wrote:

>  } else if (GET_LEVEL(ch) < LVL_IMMORT && IS_NPC(vict) &&
> !MOB_FLAGGED(vict, MOB_MOUNTABLE)) {
>     send_to_char("You can't mount that!\r\n", ch);
>     return;
> 
> becuase for me ... my level is equal to lvl_immort, so that's one fail, is
> npc should be true so that's a pass, !mob_flagged should be true so that's
> a pass == one fail means that the test failed so it can continue.

For the information of all, when evaluating an if conditional that
contains only &&s, the whole thing is turned FALSE as soon as one
condition is reached (and the rest doesn't count).  Exceptions would
be:

  if (GET_CLASS(ch) == CLASS_CLERIC && (align == -1000 || align == 1000))

Which would be true if their class was a cleric *and* align was set set
to -1000, or if their class was cleric *and* align was set to 1000.

  if ((GET_CLASS(ch) == CLASS_PALADIN && align == 1000) ||
      (GET_CLASS(ch) == CLASS_ANTI_PAL && align == -1000))

Which would be true if their class was paladin and align equaled 1000, or
if their class was anti-paladin and align was equal to -1000.  Paves the
way for a lot of weird 'if' statements...

  if (GET_LEVEL(ch) >= 20 && ((IS_PALADIN(ch) && align == 1000) ||
                              (IS_ANTI_PAL(ch) && align == -1000)))

Which means if their level is over or equal 20 and if they are either
a paladin with align set to 1000, or if they are an anti-paladin with
align set to -1000.

Sorry for getting into mostly basic C.


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| 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