[CODE] Structures, saving, initializing

From: Tony Robbins (tonyr@NWPACLINK.COM)
Date: 04/18/98


Lets say I have the following structure

struct marriage_data {
   int shared_bank;
   int mate;
   char mate_name[MAX_NAME_LENGTH+1];
   int divorced;
   char divorce_name[MAX_NAME_LENGTH+1];
   int num_divorces;
   int paid_alimony;
};

   struct marriage_data marriage;            /* Marriage data for players     */
<-- in char_data

Ok, I cannot figure out how to initialize this.

In init_char I added

ch->marriage.shared_bank = 0;
ch->marriage.mate = 0;
and so on.  It didn't work.  I get random large negative numbers for
num_divorces, etc.

I cannot get this structure to save or load, either.  Could someone point
out the stupidness of my error?


-B.  (Four letter acronym... ZUYP)


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