[Code]More race help

From: Steven Newsom (XNetplayerX@aol.com)
Date: 07/28/00


I switched th order around at chracter creation(so you choose class then
race)and made a different menu for each of the classes. It works good till it
gets to the races
then it always automatically picks human as a race.  Can anyone tell me whats
wrong with this code??
   Thnaks

In interpreter.c

 case CON_QSEX:                /* query sex of new user         */
    switch (*arg) {
    case 'm':
    case 'M':
      d->character->player.sex = SEX_MALE;
      break;
    case 'f':
    case 'F':
      break;
    default:
      SEND_TO_Q("That is not a sex..\r\n"
                "What IS your sex? ", d);
      return;
    }

    SEND_TO_Q(class_menu, d);
        SEND_TO_Q("Class: ", d);
        STATE(d) = CON_QCLASS;
        break;

  case CON_QCLERIC:
    load_result = parse_race(*arg);
    if (load_result == RACE_UNDEFINED) {
      SEND_TO_Q("\r\nThat's not a race.\r\nRace: ", d);
      return;
    } else
      set_race(d->character, load_result);

  case CON_QWARRIOR:
    load_result = parse_race(*arg);
    if (load_result == RACE_UNDEFINED) {
      SEND_TO_Q("\r\nThat's not a race.\r\nRace: ", d);
      return;
    } else
      set_race(d->character, load_result);

  case CON_QMAGICUSER:
    load_result = parse_race(*arg);
    if (load_result == RACE_UNDEFINED) {
      return;
    } else
      set_race(d->character, load_result);


  case CON_QCLASS:
    load_result = parse_class(*arg);
    if (load_result == CLASS_UNDEFINED) {
      SEND_TO_Q("\r\nThat's not a class.\r\nClass: ", d);
      return;
    } else
      GET_CLASS(d->character) = load_result;

    switch (*arg) {
    case 'c':
    case 'C':
    SEND_TO_Q(cleric_menu, d);
    SEND_TO_Q("Race:", d);
    STATE(d) = CON_QCLERIC;
    break;
    case 't':
    case 'T':
    SEND_TO_Q(thief_menu, d);
    SEND_TO_Q("Race:", d);
    STATE(d) = CON_QTHIEF;
    break;
    case 'w':
    case 'W':
    SEND_TO_Q(warrior_menu, d);
    SEND_TO_Q("Race:", d);
    STATE(d) = CON_QWARRIOR;
    break;
    case 'm':
    case 'M':
    SEND_TO_Q(magicuser_menu, d);
    SEND_TO_Q("Race:", d);
    STATE(d) = CON_QMAGICUSER;
    break;
    }


in race.c

/* New Race by class Menu by the Great Eternity:) */
const char *cleric_menu =
"\r\n"
"Select a race for your Cleric:\r\n"
"[H]uman  [E]lf\r\n";

const char *thief_menu =
"\r\n"
"Select a race for your Thief:\r\n"
"[H]uman  [E]lf \r\n";

const char *warrior_menu =
"\r\n"
"Select a race for your Warrior:\r\n"
"[H]uman  [E]lf\r\n";

const char *magicuser_menu =
"\r\n"
"Select a race for your Magic User:\r\n"
"[H]uman  [E]lf\r\n";


and father down

ACMD(do_race)
{
        int r;
        char body_parts[512];
        extern const char *body[];

        one_argument(argument, arg);

        if (*arg) {
                r = parse_race(*arg);
                sprintbit(races[r].body_bits, body, body_parts);
                sprintf(buf, "%s: %s\r\n", pc_race_types[r], body_parts);
                send_to_char(buf, ch);
        } else {
                for (r = 0; r < NUM_RACES; r++) {
                        sprintbit(races[r].body_bits, body, body_parts);
                        sprintf(buf, "%s: %s\r\n", pc_race_types[r],
body_parts$
                        send_to_char(buf, ch);
                }
        }

}



Any help is appreciated


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