Re: [CODE] more info on spell-name bug

From: Johan Dustler (Johan.Dustler@EPK.ERICSSON.SE)
Date: 12/23/97


> From: Kingmundi <Kingmundi@AOL.COM>
>
> if you make spell names with dashes in them, it causes the game to go into an
> infinite loop upon a successful cast at this point
>
> in say_spell
>
>   while (*(lbuf + ofs)) {
>     for (j = 0; *(syls[j].org); j++) {
>       if (!strncmp(syls[j].org, lbuf + ofs, strlen(syls[j].org))) {
>         strcat(buf, syls[j].new);
>         ofs += strlen(syls[j].org);
>         log(buf);
>       }

If you check struct syllable syls[] in spell_parser.c,
you will notice that there is no dash among the syllables.

Just add a new line:
{"-", "-"},

before:
{"ar", "abra"},


The syllable struct is defined as:

struct syllable {
  char *org;
  char *new;
}

say_spell compares the name of the casted spell with
the syllables in org, if a match is found the syllable
in new is added to the string that is going to be
displayed to the room.

/Johan


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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