[CODE] Stumped on such a simple problem, I think I sould hand in my degree.

From: Shay (shay@unique-software.com)
Date: 07/23/00


Ok, heres the problem, using raceclass, i have the following code implemented:

In Interpreter.c I have:

void display_classes(struct descriptor_data *d) {
   int x;
   int i, j;

   for (i = 0; i < NUM_RACES; i++)
          for (j = 0; j < NUM_CLASSES; j++)
         {
         log("class_ok_race %d:%d = %d %s", i, j, class_ok_race[i][j],
class_ok_race[i][j]);
         if (class_ok_race[i][j])
                  log("TRUE");
         else
            log("FALSE");
         }

   send_to_char("Class selection menu - please choose a
class\r\n--------------------\r\n", d->character);
   log("Race -- %s %d", pc_race_types[GET_RACE(d->character)],
GET_RACE(d->character));
   for (x = 0; x < NUM_CLASSES; x++)
         {
     log("Value = %d %s %i", class_ok_race[x][x], class_ok_race[x][x],
class_ok_race[x][x]);
     log("X=%d  NUM_CLASSES=%d  NUM_RACES=%d Class_ok_race=%s Int=%d", x,
NUM_CLASSES, NUM_RACES, class_ok_race[(int)GET_RACE(d->character)][x],
(int)GET_RACE(d->character));
     if (class_ok_race[(int)GET_RACE(d->character)][x])
       send_to_char(class_display[x], d->character);
     }
   send_to_char("\nClass: ", d->character);
}

And In class.c I Have:

#define Y   TRUE
#define N   FALSE
int class_ok_race[NUM_RACES][NUM_CLASSES] = {
   /*            M, C, T, W */
   /* Human */ { Y, Y, Y, Y },
   /* Elf   */ { Y, Y, Y, N },
   /* Gnome */ { Y, Y, N, Y },
   /* Dwarf */ { N, Y, N, Y },
   /* Vamp  */ { Y, N, N, Y }
};

now the debugging i have in the first part puts the following out to log,
which is nothing but 0's, or false.  It sould be true, true, true, etc...
from the class...  What am i missing????????????  Reminder, Im a C++ guy,
not C.. ;)  so I have my excuses for asking, atleast in
my mind I do.. hehehe

Jul 23 20:04:39 :: class_ok_race 0:0 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 0:1 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 0:2 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 0:3 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 1:0 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 1:1 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 1:2 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 1:3 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 2:0 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 2:1 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 2:2 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 2:3 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 3:0 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 3:1 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 3:2 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 3:3 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 4:0 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 4:1 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 4:2 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: class_ok_race 4:3 = 0 (null)
Jul 23 20:04:39 :: FALSE
Jul 23 20:04:39 :: Race -- Dwarf 3
Jul 23 20:04:39 :: Value = 0 (null) 0
Jul 23 20:04:39 :: X=0  NUM_CLASSES=4  NUM_RACES=5 Class_ok_race=(null) Int=3
Jul 23 20:04:39 :: Value = 0 (null) 0
Jul 23 20:04:39 :: X=1  NUM_CLASSES=4  NUM_RACES=5 Class_ok_race=(null) Int=3
Jul 23 20:04:39 :: Value = 0 (null) 0
Jul 23 20:04:39 :: X=2  NUM_CLASSES=4  NUM_RACES=5 Class_ok_race=(null) Int=3
Jul 23 20:04:39 :: Value = 0 (null) 0
Jul 23 20:04:39 :: X=3  NUM_CLASSES=4  NUM_RACES=5 Class_ok_race=(null) Int=3


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