Re: [NEWBIE][CODE]

From: Allan Rolf Gortemaker (umgortem@CC.UMANITOBA.CA)
Date: 02/11/98


> Hello,
>
> I am trying to add a few classes and am using the race/class snippet by
> Nashak. I have debugged most of the problems that still exist with my
> certain setup but am still getting the following errors while trying to
> compile:
>
> make ../bin/circle
> make[1]: Entering directory `/stor/src/circle30bpl11/src'
> gcc -c -g -O -Wall -fno-strict-prototypes  interpreter.c
> interpreter.c: In function `display_classes':
> interpreter.c:1075: `ch' undeclared (first use this function)
> interpreter.c:1075: (Each undeclared identifier is reported only once
> interpreter.c:1075: for each function it appears in.)
> make[1]: *** [interpreter.o] Error 1
> make[1]: Leaving directory `/stor/src/circle30bpl11/src'
> make: *** [default] Error 2
>
>
> The following is the part of the code snippet that is causing the problem:
>
>

Um...yeah in line 1075 it tries to call GET_RACE with ch which isn't
defined in this function.  Try replacing 'ch' in GET_RACE(ch) with
d->character so the line is as follows:

   if (class_ok_race[(int)GET_RACE(d->character)][x])

Should fix the problem

Kymaro

>                 void display_classes(struct descriptor_data *d) {
>                 int x;
>
>                 send_to_char("Class selection menu - please choose a
> class\r\n----------------
>                 ----\r\n", d->character);
>                 for (x = 0; x < NUM_CLASSES; x++)
> Line:1075      if (class_ok_race[(int)GET_RACE(ch)][x])
>                   send_to_char(class_display[x], d->character);
>                   send_to_char("\nClass: ", d->character);
>                 }
>
> I have pored over this and cannot find a typo or anything else of the sort.
> Any help or insight is most appreciated.
>
> Regards,
>
> wyrm
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+


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