Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Changing available classes for selection

Changing available classes for selection

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Syriac   (46 posts)  Bio
Date Sat 20 Jun 2009 08:13 PM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 20 Jun 2009 09:57 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,887 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.