>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. I tried this. It crashes mine on if(GET_NAME(dt->character) && !str_cmp(GET_NAME(dt->character), newname)). But simply doing a check like: for (dt = descriptor_list; dt; dt = dt->next) if(GET_NAME(dt->character)) continue; else return FALSE; does top them from making characters with the same name (same cases that is). Please don't think I'm trying to be a smart ass with this, I'm just trying to understand it better. Chuck +------------------------------------------------------------+ | 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