Re: [Code] spell name is hanging the MUD

From: George (
Date: 11/27/98

On Fri, 27 Nov 1998, The Realms of Tremaria wrote:

>Also, Mr. Greer metioned that log() entries are my best friend.  I agree,
>for that is how I resolved where the problem was occuring and what the
>problem is.  log() entries do not tell me why things happen as they do,
>and that is what I am really looking for so I can correct these errors
>before they happen.

Ok, I'll be a bit more explicit:

void say_spell(struct char_data * ch, int spellnum, struct char_data * tch,
                    struct obj_data * tobj)
  char lbuf[256];

  struct char_data *i;
  int j, ofs = 0;

  *buf = '\0';
  strcpy(lbuf, spells[spellnum]);

  log("Starting the loop. (%d)", time());

  while (*(lbuf + ofs)) {

    log("String left='%s' ofs=%d", lbuf + ofs, ofs);

    for (j = 0; *(syls[j].org); j++) {
      if (!strncmp(syls[j].org, lbuf + ofs, strlen(syls[j].org))) {
        strcat(buf, syls[j].news);
        ofs += strlen(syls[j].org);

  log("It's not the loop, honest. (%d)", time());

  if (tch != NULL && tch->in_room == ch->in_room) {

Then whatever the first character of 'string left' is repeatedly is your

So you'll probably want to add that to the table.

George Greer, | Genius may have its limitations, but   (mostly) | stupidity is not thus handicapped.    |                  -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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