Re: Duping Bugfix

From: George (greerga@CIRCLEMUD.ORG)
Date: 01/16/98


On Fri, 16 Jan 1998, Chuck Reed wrote:

>if(!GET_NAME(dt->character) && strcmp(GET_NAME(dt->character, newname)))
>    return blah;
>
>It crashes cuase it tries to find the name that it just said wasn't there.

Um, the original way I had it was:

+  for (dt = descriptor_list; dt; dt = dt->next)
+    if (GET_NAME(dt->character) && !str_cmp(GET_NAME(dt->character), newname))
+      return FALSE;

(Note the lack of ! in the GET_NAME.)

Putting the ! on there only does a str_cmp if their name is NULL, not quite
what you want.  In my original way it only does a str_cmp if the person's
namne does exist, which is everyone except for the person being created.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | 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/15/00 PST