Re: Problems with GET_RACE(ch)

From: Alex Mann (
Date: 06/09/02

> >However, when ever I try to call GET_RACE(ch), such as in do_score using
> >call, I get the following compiler error:
> >
> >warning; format argument is not a pointer (arg 4)
> >
> >#define RACE_UNDEFINED    -1
> >#define RACE_HUMAN        0
> >#define RACE_ELF          1
> >#define RACE_TROLL        2
> >#define RACE_DWARF        3
> >#define RACE_HALFLING     4
> >
> >#define NUM_RACES         5
> >
> >So it looks like somewhere GET_RACE got set to be an integer and not a
> >But i can't seem to find it anywhere in the code, it all looks fine.
>No, it's an int to start with.  GET_RACE() is probably defined as
>((ch)->player.race) which is stored as an int.
>To print out the race names, you need an array like
>char *race_name[]={"human", "elf", "troll", "dwarf", "halfling"};
>then in the sprintf you'd use race_names[GET_RACE(ch)].
>Make sure to check for RACE_UNDEFINED before calling it or you'll blow
>the place up again.
>Either that or start them at 0 instead of -1, and add "Undefined" as the
>first element of the array.


Just a quick thanks, this worked fine, not quite sure why I had to do it
this way this time but not last time, but hey as long as it works.


Chat with friends online, try MSN Messenger:

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT