Re: Writing to world file in db.c

From: George (greerga@CIRCLEMUD.ORG)
Date: 04/01/98


On Wed, 1 Apr 1998, Shaw wrote:

>    get_line(mob_f, line);
>    sscanf(line, " %d %d %d", t, t + 1, t + 2);
>         GET_GOLD(mob_proto + i) = t[0];
>         GET_EXP(mob_proto + i,0) = t[1];
>         GET_APR(mob_proto +1) = t[2];
>
>GET_APR is the new addition to the format.  My idea is to check to see if there
>are 3 numbers in the line, and if not find out which is missing and fill in some
>default value and write it to the file.

Check the return value of sscanf().  If it is 2 you have the hole, if it
returns 3, it has all the fields already.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


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