[CODE] SEND_TO_Q ...

From: Deja Augustine (PraetorXI@aol.com)
Date: 03/19/00


Okay, I have a confusing problem...Below is the code for a function I wrote.
I pointed out two spots where I've tried commenting  out everything between
that spot and the end, including that line in the commenting.  It seems to
crash when I use the SEND_TO_Q macro.

Can anyone tell me why this is happening?

-Praetor

(BTW, I'm using bpl17, and I have a function right above this one that uses
SEND_TO_Q successfully)

--------------------------Code Below----------------------------------------
int parse_get_spells(char *arg, struct descriptor_data *d) {

  char cmd[MAX_INPUT_LENGTH];
  char spell[MAX_INPUT_LENGTH];
  int spell_num, check_skill;

  if(!*arg)
    return (0);
  /*else        <~~~If I comment here, it works
    SEND_TO_Q("\r\nArgument\r\n",d);

  /*SEND_TO_Q(arg, d);  <~~~If I comment here, it Seg Faults
  arg = one_argument(arg, spell);
  strcpy(cmd, arg);

  check_skill = 0;

  for(spell_num = 1;spell_num <= NUM_SPELLS;spell_num++) {
    if(!strcmp(CLASS_SPELL[spell_num][NUM_CLASSES], spell) && \
       !strcmp(CLASS_SPELL[spell_num][GET_CLASS(d->character)], "YES"))
      break;
    if(spell_num == NUM_SPELLS)
      check_skill = 1;
  }

  if (check_skill == 1) {
   for (spell_num = 1;spell_num <= NUM_SKILLS;spell_num++) {
     if(!strcmp(CLASS_SKILL[spell_num][NUM_CLASSES + 1], spell) && \
        !strcmp(CLASS_SKILL[spell_num][GET_CLASS(d->character)], "YES")) {
       spell_num += 130;
       break; }
     if(spell_num == NUM_SKILLS)
       return (0);
   }
  }

  if(!strcmp(cmd, "add")) {
    KNOW_SPELL(d->character, spell_num) = 1;
    CREATION_PTS(d->character) += atoi(CLASS_SKILL[spell_num][NUM_CLASSES +
2]);
    return (1);
  }
  else if (!strcmp(cmd, "drop")) {
    KNOW_SPELL(d->character, spell_num) = 0;
    CREATION_PTS(d->character) -= atoi(CLASS_SKILL[spell_num][NUM_CLASSES +
2]);
    return (1);
  }
  else if (!strcmp(cmd, "list")) {
    return (3);
  }
  else if (!strcmp(cmd, "done")) {
    return (5);
  }
  else */  <~~~~~~~~~~~~~~~~~~~~~~End Comment
    return (0);

}


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