Re: [Circle][CODE] Race Class Problem Im Having

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 07/24/00


Shay wrote:
>
> void display_classes(struct descriptor_data *d) {

<snip>
>
> This is the code i got from the ftp site, atleast part of it, for doing
> race-classes.
> The problem is the GET_RACES(ch), where ch is unidentified.  Ive tried to sort
> this out with d->character, but thats not quite right.
>
d->character should work in this case.

> If someone knows a fix for this, that would be great, but im also trying to
> figure
> out how to get some variables to display to the screen besides char's.  Id like
> to just see what GET_RACES(d->character) returns, but im more familiar with
> C++, not C.

I can find no GET_RACES macro in the race patch avaliable on the ftp
site (are we looking at the same patch?)  I can see a GET_RACE macro,
though...

from the race patch...

> diff -uprN ../with/utils.h ./utils.h
> --- ../with/utils.h   Mon Jul 27 19:20:43 1998
> +++ ./utils.h Mon Jul 27 19:26:27 1998
> @@ -252,6 +252,7 @@ void      update_pos(struct char_data *victim
>      GET_LEVEL(ch))
>
> #define GET_CLASS(ch)   ((ch)->player.chclass)
> +#define GET_RACE(ch) ((ch)->player.race)

okay, so GET_RACE(ch) is the same as (ch)->player.race

So, GET_RACE(d->character) would return d->character->player.race

also in the races patch...

> diff -uprN ../with/structs.h ./structs.h
> --- ../with/structs.h Mon Jul 27 19:20:43 1998
> +++ ./structs.h       Mon Jul 27 19:23:46 1998
> @@ -106,6 +106,12 @@
>  #define CLASS_DRAGON      4
>  #define CLASS_GIANT       5
>
> +/* Races */
> +#define RACE_UNDEFINED       -1
> +#define RACE_HUMAN   0
> +#define RACE_DWARF   1
> +#define RACE_ELF     2
> +#define RACE_HOBBIT  3

 ...

> @@ -681,6 +692,7 @@ struct char_player_data {
>     char      *title;        /* PC / NPC's title                     */
>     byte sex;           /* PC / NPC's sex                       */
>     byte chclass;       /* PC / NPC's class                  */
> +   byte race;          /* PC / NPC's race                      */

So by this GET_RACE returns a byte value according to the character's
race as defined above.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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