Changing available classes for selection

Posted by Syriac on Sat 20 Jun 2009 08:13 PM — 2 posts, 11,274 views.

#0
Hey guys, I'm sure this is something really simple I'm over looking and may have this fixed before anyone responds but here is what I'm trying to do. On my MUD there are tiers available to advance to when a player maxes out a certain class, one of the previous classes (Rogue) has been changed to a tier of Thief. I am now having a problem hiding rogue from being selectable. Since I made the class before I coded any tiers its class number is in the middle of everything and I can't change it without screwing up files, and I can't hide it with MAX_CLASS-X so I created a simple slot in the class files where 0 means its selectable and any other value means its not. I tried to add that into the portion in comm.c where a player selects his or her class but it doesn't seem to eleminate the rogue class. Here's the code:


1	for ( iClass = 0; iClass < MAX_PC_CLASS-5; iClass++ 2)
3        {
4            if ( class_table[iClass]->who_name &&
5                 class_table[iClass]->who_name[0] != '\0' )
6            {
7              if ( iClass > 0 && class_table[iClass]->avail == 0 )
              {
                  if ( strlen(buf)+strlen(class_table[iClass]->who_name) > 77 )
                  {
                     strcat( buf, "\n\r" );
                     write_to_buffer( d, buf, 0 );
                     buf[0] = '\0';
                  }
                  else
                     strcat( buf, " " );
              }
            }
            pager_printf_color(ch," &z[&W%s&z] ",class_table[iClass]->who_name);
        }


Its the 7th line I'm looking at...
Australia Forum Administrator #1
Try running under gdb and putting a breakpoint on that line. It seems a funny idea to have 0 as being available, but oh well. Maybe it has the value '0' rather than 0.