Help with if statement.

From: Del Minturn (caminturn@EARTHLINK.NET)
Date: 10/05/98


I am brain farting or something on this one. I have been trying to get
this working right and something is just not right.

My remort code is looking for the input from the PC, and converts the
argument to the class number.

Then it checks to see what your class is and if your trying to remort to
a class that you should not be. (Please no arguments on why).

   if((IS_WARRIOR(ch)) && (x == ((CLASS_CRUSADER) || (CLASS_WARLOCK) ||
(CLASS_ASSASSIN)))) {
    send_to_char("You can only select a Knight, Cleric, Thief, Warrior
or Sorcerer.\r\n", ch);
    return;
    }

The character I am trying is a warrior, and tried to remort to assassin.
This check does not work right.

X is equal to  4.
Crusader = 5, Warlock = 7, Assassin = 4, Knight = 6.

I put a sprintf in to see what the variables are.. and x and assassin
are 4 but the check still fails.. I have tried moving/adding more ()'s
but can't seem to get the right combination. What am I doing wrong?


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST