Re: Races

From: Todd A Laycock (
Date: 07/18/00

On Tue, 18 Jul 2000, Sharon Stanton wrote:

> hi
> i am trying to put in races but i run into a problem with db.c
> Search for:
>   GET_CLASS(ch) = st->class;
> Below it, add:
>   GET_RACE(ch) = st->race;
> Search for:
>   st->class = GET_CLASS(ch);
> Below it, add:
>   st->race = GET_RACE(ch);
> but since i got Ascii Pfiles in all of that has changed
> could someone help me install race??
> JS

In our ascii pfiles we added the following to save races:

in pfdefaults.h -
add a line "#define PFDEF_RACE 0" or whatever the equivalent is for race
undefined or whatever you want it to be (race human, etc).

Then in db.c -
find void save_char(blah blah....
and there should be a point where it says:

    fbprintf(fl, "Clas: %d", GET_CLASS(ch));

below it add:

  if(GET_RACE(ch) != PFDEF_RACE)
    fbprintf(fl, "Race: %d", GET_RACE(ch));

then find int load_char(blah blah...  and where you see:




and lower:

  case 'R':
    else if(!strcmp(tag, "Race"))
      GET_RACE(ch) = num;

That's all you need to do to get races to load and save properly.
If you have to add more vars that you want to save and load from the
pfile, you add them in the same fashion.

Todd A Laycock - MirrorsMUD

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT