Re: [long] AFF2 flag

From: Kras Kresh (kras_kresh@hotmail.com)
Date: 06/04/02


>From: Ray Campbell <thrawn@COX.NET>
>I decided to go the AFF2 route after many failed attempts at adding 128
>bits to my
>heavily modified, now pl19 code base.  This question is posed pertaining to
>ASCII pfiles
>and the saving of the AFF2 flags to the file.  I copied all instances of
>AFF, in db.c (I believe this is the only place that handles setting up the
>pfiles?)  My code compiles just fine, but the AFF2 flags aren't actually
>working.  No weird crashes are happening, it just won't affect the
>character.

--snip--

>above, num6 was added with the af.bitvector2 in db.c, to me this seemed
>like the obvious
>place where it was setting up the structure of what to write in the pfile.
>Again, I just followed all instances of AFF.  Does anyone see a problem
>with the above.  One thing I was unsure of, is if that I had to actually
>make all new af.xxx structures, for the new aff2 flags.  It appeared that
>just adding a  .bitvector2 to struct affected_type in structs.h should do
>the trick.  Perhaps i'm wrong?
>My other question, and this I believe is what is making the actuall AFF2
>flag not stick to the character to begin with is this in utils.c:

Try printing out the AFF2 flag and see if it loads onto your character.

>void sprintbit(bitvector_t bitvector, const char *names[], char *result)
>{
>   long nr;
>
>   *result = '\0';
>
>   for (nr = 0; bitvector; bitvector >>= 1) {
>     if (IS_SET(bitvector, 1)) {
>       if (*names[nr] != '\n') {
>         strcat(result, names[nr]);
>         strcat(result, " ");
>       } else
>         strcat(result, "UNDEFINED ");
>     }
>     if (*names[nr] != '\n')
>       nr++;
>   }
>
>   if (!*result)
>     strcpy(result, "NOBITS ");
>}
>
>I tried adding the bitvector2 into the for loop, and also the void, but
>then I got a ton of mismatches on compilation, so i put it back to the
>stock for, above.  I was wondering if I would have to write a complete new
>sprintbit2 ? or if there was a way I could add the bitvector2 into that
>loop so It would set the affection to the character.

I think all you need to do is follow one of those patches for 128 bit.
Its basically the same thing you are trying to code up, just it uses aff[x]
instead of aff and aff2 -- just an example.

ftp://ftp.circlemud.org/pub/CircleMUD/contrib/code/utils/128bit.patch

It's probably something you want to try looking at. It changes practically
all the flags.. so if you don't want to change it all, just take the parts
you want. Might want to read the README files as well.

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

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