[CODE] Remort Command Help

From: Leonard Burns IV (lburns@continet.com)
Date: 12/05/96


I have put in a remort command so people can remort. I am having trouble
getting a single letter input from the player, they run the command and
it executes fine, no crashes, and then 6 screens with their stats whiz
by, obviously I have done something wrong. Any help from you code gurus?
I am calling this function with remort_stat(ch);

/******** REMORT CODE ********/
void remort_stat(struct char_data * ch)
{
  int a;

  send_to_char("\r\nCongratulations on your remort!\r\n", ch);
  send_to_char("To add to your stats simply type the letter of the
stat.\r\n", ch);
  send_to_char("There is no changing the stat once you add to it.\r\n",
ch);

  sprintf(buf, " (S)tr: %d/%d\r\n (I)nt: %d\r\n (W)is: %d\r\n (D)ex:
%d\r\n (C)on: %d\r\n C(h)a: %d\r\n",
	ch->real_abils.str, ch->real_abils.str_add, ch->real_abils.intel, 
        ch->real_abils.wis, ch->real_abils.dex, ch->real_abils.con, 
        ch->real_abils.cha);
  send_to_char(buf, ch);  

  switch(a) {
  case 's':
  case 'S':
    if (ch->real_abils.str >= 25)
      break;
      ch->real_abils.str = ch->real_abils.str + 1;
      return;
  case 'i':
  case 'I':
    if (ch->real_abils.intel >= 25)
      break;
      ch->real_abils.intel = ch->real_abils.intel + 1;
      return;
  case 'w':
  case 'W':
    if (ch->real_abils.wis >= 25)
      break;
      ch->real_abils.wis = ch->real_abils.wis + 1;
      return;
  case 'd':
  case 'D':
    if (ch->real_abils.dex >= 25)
      break;
      ch->real_abils.dex = ch->real_abils.dex + 1;
      return;
  case 'c':
  case 'C':
    if (ch->real_abils.con >= 25)
      break;
      ch->real_abils.con = ch->real_abils.con + 1;
      return;
  case 'h':
  case 'H':
    if (ch->real_abils.cha >= 25)
      break;
      ch->real_abils.cha = ch->real_abils.cha + 1;
      return;
  default:
      remort_stat(ch);
      return;
 }
}
/******** END OF CODE ********/
-- 
Leonard Burns IV
lburns@continet.com
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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