CON_Q's

From: Nick B (nick@connecti.com)
Date: 07/24/96


Even with the added if statements, I still have a duplicate case value error
for CON_QCLASS and CON_QRACE.  Here are the lines of code:

  SEND_TO_Q(race_menu, d);
    SEND_TO_Q("\r\nRace: ", d);
    STATE(d) = CON_QRACE;
    break;
    

  case CON_QRACE:
    load_result = parse_race(*arg);
    if (load_result == RACE_UNDEFINED) {
      SEND_TO_Q("\r\nThat is not a valid race.\r\nRace: ", d);
      return;
    } 
    GET_RACE(d->character) = load_result;
    
    if (GET_RACE(ch) == RACE_HUMAN) { 
      SEND_TO_Q(human_class_menu, d);
    } else if (GET_RACE(ch) == RACE_WOOKIE) 
      SEND_TO_Q(wookie_class_menu, d);
    SEND_TO_Q("\r\nClass: ", d);
    STATE(d) = CON_QCLASS;
    break;

  case CON_QCLASS:
    load_result = parse_class(*arg, 0);
    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;


What is my problem????  ALSO, the lines of code below, it tells me that
"function reaches end of non-void statement" on the last line with the
ending bracket for both functions.  Is it that I can't put the if's in, or what?

First function:

int parse_class(char arg)
  
{
  arg = LOWER(arg);
   
  switch (arg) {
  
  case 'j':
    if (GET_RACE(ch) == RACE_HUMAN) {
    return CLASS_JEDI;
    } if (GET_RACE(ch) == RACE_WOOKIE) 
    return CLASS_UNDEFINED; 
    break; 
  case 'f':  
    return CLASS_FIGHTER;
    break;
  default:
    return CLASS_UNDEFINED; 
    break;
  }
}



Second function:

long find_class_bitvector(char arg)
{
  arg = LOWER(arg);

  switch (arg) {
    case 'j':
      if (GET_RACE(ch) == RACE_HUMAN) { 
      return (1 << 0); 
    } else if (GET_RACE(ch) == RACE_WOOKIE) 
      return 0; 
      break;
    case 'f':
      return (1 << 1);
      break;
    default:
      return 0;
      break;
  }
}





Can someone please tell me what is the matter?

  
Nicholas T. Becker

nick@connecti.com



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