If you follow comments below, what does set_race do? And your missing break;'s Steven Newsom wrote: > > 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 > I glanced at this and tried to follow the code: (see comments) > 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': ** This is preset to female? > break; > default: > SEND_TO_Q("That is not a sex..\r\n" > "What IS your sex? ", d); > return; > } > send the menu and parse results > SEND_TO_Q(class_menu, d); > SEND_TO_Q("Class: ", d); > STATE(d) = CON_QCLASS; > break; > Ok.. we jump down to CON_QCLASS <returning back up here from below, Since you say human always shows up> <I say Elf (since thats the only other possible choice> > 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); ** Ok it should be Elf (E), what does set_race do?? ********************************************************************** You do not have a break or return here.. it continues on to next case. ********************************************************************** > > 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); > parsed the response here.. lets try cleric. > case CON_QCLASS: > load_result = parse_class(*arg); cleric > 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; ok we be cleric > > switch (*arg) { > case 'c': > case 'C': > SEND_TO_Q(cleric_menu, d); > SEND_TO_Q("Race:", d); > STATE(d) = CON_QCLERIC; > break; ok, send the cleric menu and parse, skipping to CON_QCLERIC > case 't': > case 'T': <snip> > 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"; > +------------------------------------------------------------+ | 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