Re: [CODE] Ascii pfiles & 128-bit flags

From: Richard Glover (magik@thegrid.net)
Date: 02/19/99


load_char():
With the other initiations...

    for (i = 0; i < PM_ARRAY_MAX; i++)
      csds->act[i] = 0;
    for (i = 0; i < AF_ARRAY_MAX; i++)
      csds->affected_by[i] = 0;
    for (i = 0; i < PR_ARRAY_MAX; i++)
      psds->pref[i] = 0;

later on...

      case 'A':
        if (!strcmp(tag, "Ac  "))
          cpd->armor = num;
        else if (!strcmp(tag, "Act ")) {
   sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
          csds->act[0] = asciiflag_conv(f1);
   csds->act[1] = asciiflag_conv(f2);
   csds->act[2] = asciiflag_conv(f3);
   csds->act[3] = asciiflag_conv(f4);
        } else if (!strcmp(tag, "Aff ")) {

        } else if (!strcmp(tag, "Aff ")) {
   sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
   csds->affected_by[0] = (uint)asciiflag_conv(f1);
          csds->affected_by[1] = asciiflag_conv(f2);
          csds->affected_by[2] = asciiflag_conv(f3);
          csds->affected_by[3] = asciiflag_conv(f4);
        } else if (!strcmp(tag, "Affs")) {

 else if (!strcmp(tag, "Pref")) {
          sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
          psds->pref[0] = asciiflag_conv(f1);
          psds->pref[1] = asciiflag_conv(f2);
          psds->pref[2] = asciiflag_conv(f3);
          psds->pref[3] = asciiflag_conv(f4);
 } else if (!strcmp(tag, "Prmt"))


save_char():
  fprintf(outfile, "Act : %u %u %u %u\n", csds->act[0], csds->act[1],
      csds->act[2], csds->act[3]);
  fprintf(outfile, "Aff : %u %u %u %u\n", csds->affected_by[0],
      csds->affected_by[1], csds->affected_by[2], csds->affected_by[3]);
  fprintf(outfile, "Pref: %u %u %u %u\n", psds->pref[0], psds->pref[1],
      psds->pref[2], psds->pref[3]);

If some part of this doesn't work...fix it!  8)  You may have to change the
format chars (%u) or put typecasting somewhere, but that's the format.

Rick

-----Original Message-----
From: Roger Smith <sexycoder@hotmail.com>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Friday, February 19, 1999 9:25 PM
Subject:  [CODE] Ascii pfiles & 128-bit flags


>I just installed ascii pfiles and i am experiencing problems with
>load_char() in db.c because of 128-flags.
>Does anybody know how to read the PLR_, PRF_, and AFF_ flags in
>load_char() with ascii pfiles AND 128-bit flags?  And how to write the
>the flags to the pfiles?
>
>Thank you,
>Roger


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