CODE: AFF_AFFECT bitvector limit?

From: Robert Moon (LegalWriter@earthlink.net)
Date: 04/05/99


Is there a maximum number of bitvectors that can be defined as affection
bits?  From a fresh copy of Circle3 p15, I added 50 new spells in one
fell swoop.  31 of those spells required an affection bitvector, which I
added in structs.h.

My structs.h file now looks like this:


...[snip]

#define AFF_SNEAK        (1 <<<< 18)       /* Char can move quietly */
#define AFF_HIDE         (1 <<<< 19)       /* Char is hidden                */
#define AFF_UNUSED20        (1 <<<< 20)    /* Room for future expansion */
#define AFF_CHARM        (1 <<<< 21)       /* Char is charmed           */
#define AFF_FREE_ACTION  (1 <<<< 22)   /* Char cannot be held, slowed */
#define AFF_RESIST_FIRE  (1 <<<< 23)   /* Char takes 50% fire damage */
#define AFF_RESIST_COLD  (1 <<<< 24)   /* Char takes 50% cold damage */
#define AFF_GROUNDING    (1 <<<< 25)   /* Char immune to lightning */
#define AFF_IMMUNE_FIRE  (1 <<<< 26)   /* Char immune to fire */

...[snip]

#define AFF_SILENCE      (1 <<<< 53)   /* Char is silenced */

Only the first 3 new bitvectors (FREE_ACTION-22, RESIST_FIRE-23, and
RESIST_COLD-24) actually work.  The remainder (25-53) all cause this
warning in every file that references the bitvectors when I compile:
   warning: left shift count >= width of type

For example, the above warning occurs 28 times when I compile my magic.c
file.  Each warning corresponds to the af[0].bitvector = AFF_[affect]
line as follows:


  case SPELL_BARKSKIN:
    af[0].location = APPLY_AC;
    af[0].modifier = -20;
    af[0].duration = 24;
    af[0].bitvector = AFF_BARKSKIN    <<--- "left shift" warning on this line
    accum_duration = TRUE;
    to_vict = "Your skin hardens into dense bark.";
    break;

When the new problematic spells are cast in-game, they take effect with
the proper to_char echoes, but then they take ANOTHER bitvector.  For
instance, when I cast "Immunity to Fire", it actually sets
AFF_IMMUNE_COLD.  When I cast "Fly", it sets AFF_DISEASE.  I've
triple-checked my magic.c file to make sure the proper bitvectors are
being assigned to their respective spells.

What is going on?  How do I overcome this problem?  Any help is much
appreciated.  Thanks.

--Robert Moon.

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



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