Re: db.c parse_simple_mob

From: Zizazat Lazuras (zizazat@hotmail.com)
Date: 12/10/01


> > I have usesd bpl15 (and prior) to read a race and class value from > >
>the mob file in parse_simple_mob. I just added two extra %d and t+2 > > t+3
>to the line where gold and exp are read in.
>
>How did you modify that line?  That's the first place I'd look, but you
>didn't supply it.

The exact code is as follows:

if (sscanf(line, " %d %d %d %d ", t, t + 1, t + 2, t + 3) != 4) {
    log("SYSERR: Format error in mob #%d, second line after S flag\n"
        "...expecting line of form '# #'", nr);
    exit(1);
  }

  GET_GOLD(mob_proto + i) = t[0];
  GET_EXP(mob_proto + i) = t[1];
  GET_RACE(mob_proto + i) = t[2];
  GET_CLASS(mob_proto + i) = t[3];

As I said, it reads the race just fine...but everyone ends up with a class
of Magic User (0).

Modified of course from:

if (sscanf(line, " %d %d ", t, t + 1) != 2) {
    log("SYSERR: Format error in mob #%d, second line after S flag\n"
        "...expecting line of form '# #'", nr);
    exit(1);
  }

  GET_GOLD(mob_proto + i) = t[0];
  GET_EXP(mob_proto + i) = t[1];

--Ziz

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
   +---------------------------------------------------------------+
   | 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/24/03 PDT