[ASCII 2.0b] Bug fix for stat loading

From: The Fractal Dimension Staff (fracdime@GEOCITIES.COM)
Date: 06/24/98


I have it!

Ok, after your poor, unsuspecting player's stats are loaded from his
file, into aff_abils, the affects are loaded last of all and
affect_total is called, which sets aff_abils to real_abils, (at this
point real_abils is zero!) and their stats are zero once again.

The fix?

Replace the whole line of struct affected_types instantiations in
load_char with this line:

struct affected_type tmp_aff[MAX_AFFECT];

Put this section right after the PFDEFAULT section and before the
while loop that parses the tags:

    for (i = 0; i < MAX_AFFECT; i++) {
      tmp_aff[i].type = 0;
      tmp_aff[i].duration = 0;
      tmp_aff[i].bitvector = 0;
      tmp_aff[i].modifier = 0;
      tmp_aff[i].location = APPLY_NONE;
    }

Replace this section from parsage of affs: tag:

af.type = num;
af.duration = num2;
af.modifier = num3;
af.location = num4;
af.bitvector = num5;
affect_to_char(ch, &af);

With:

tmp_aff[i].type = num;
tmp_aff[i].duration = num2;
tmp_aff[i].modifier = num3;
tmp_aff[i].location = num4;
tmp_aff[i].bitvector = num5;

Finally, right after ch->real_abils = ch->aff_abils line insert this:

for (i = 0; i < MAX_AFFECT; i++) {
  if (tmp_aff[i].type)
    affect_to_char(ch, &tmp_aff[i]);
}

That's the fix, hope you liked it. :)


.-------------------------------------------------.
|     Administration of The Fractal Dimension     |
|         "Non-existent MUD of the Year"          |
|       Reach us at fracdime@geocities.com        |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'


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