Re: [circle][code] Bitvectors

From: Henrik Stuart (hstuart@geocities.com)
Date: 01/05/02


Greetings,

> #define SET_AFFECT(ch,flag) (((ch)->char_specials.saved.\
>    affected_by[((flag) /32)]) = (1 << ((flag) %32)))

   Ok, another slight error. :o)

   Whenever you try to set an affect it will clear all others in the
   index of the array.... sooo.... use this instead:

   #define SET_AFFECT(ch,flag) \
   (((ch)->char_specials.saved.affected_by[((flag)/(sizeof(long)*32))]) \
   |= (1 << ((flag) % (sizeof(long)*8)))

   Sorry about the extra post just noticed when I pressed send. :o)
   Better go sleep now.

--
Yours truly,
  Henrik Stuart (http://www.unprompted.com/hstuart/)

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT