[Code] Can't Find my Bug =(

From: DJ Pure (pure@ozramp.net.au)
Date: 12/11/96


G'Day all.
I'm trying to find the bug in my code here.

this is what i have ->

<interpreter.c, CON_MENU>
....
const sh_int r_mortal_start_room [NUM_HOMETOWNS][NUM_CLASSES];
...
      /* If char was saved with NOWHERE, or real_room above failed... */
      if (load_room == NOWHERE) {
		  if (GET_LEVEL(d->character) >= LVL_IMMORT) {
		  load_room = r_immort_start_room;
		  }
		  else {
		  // Hometown / Class Guild updated now. - Jus  **** HERE *****
		  load_room =
r_mortal_start_room[GET_HOME(d->character)][GET_CLASS(d->character)];
		  }
      }
now, i believe that load_room should be 1000 (lets say if that's where
everyone will load into room vnum 1000 for this example).

well, load_room != 1000 or whatever. it's somethinng totally different.

now this is my 2d array.

<in config.c>
const sh_int mortal_start_room[NUM_HOMETOWNS][NUM_CLASSES] = {
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000},
	{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000}
 };

<in structs.h>
...
#define NUM_HOMETOWNS 	15
#define NUM_CLASSES 	14

so i can't see why it doesn't work. Oh. And i've printed out the values of
GET_HOME and GET_CLASS, and they seemed to be fine (the number of the
hometown city AND the players class).

well, the only way i can think of a problem happening is in here ...

<in db.c>
...
/// make sure the start rooms exist & resolve their vnums to rnums
// This over wrote the old check_start_rooms, ***** taken from the snippets
page.*****
void check_start_rooms(void)
{
  int city_count, room_count;
  extern sh_int mortal_start_room[NUM_STARTROOMS][NUM_CLASSES]; 
  extern sh_int immort_start_room;
  extern sh_int frozen_start_room;

   for (city_count = 0; city_count <= NUM_HOMETOWNS; city_count++){ 
	   for (room_count = 0; room_count <= NUM_CLASSES; room_count++) { 
		   if ((r_mortal_start_room[city_count][room_count] =  
				real_room(mortal_start_room[city_count][room_count])) < 0) {
			  if (city_count > 1)
				r_mortal_start_room[city_count][room_count] = 
					real_room(mortal_start_room[0][0]);
			  else {
				 log("SYSERR:  Mortal start room does not exist.  Change in
config.c.");
				 exit(1);
			  }
		   }
	   }
   }

  if ((r_immort_start_room = real_room(immort_start_room)) < 0) {
    if (!mini_mud)
      log("SYSERR:  Warning: Immort start room does not exist.  Change in
config.c.");
    r_immort_start_room = r_mortal_start_room[0][0];
  }
  if ((r_frozen_start_room = real_room(frozen_start_room)) < 0) {
    if (!mini_mud)
      log("SYSERR:  Warning: Frozen start room does not exist.  Change in
config.c.");
    r_frozen_start_room = r_mortal_start_room[0][0];
  }
}


any idea's peoples? Thanks heaps in advance ...

jussy

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST