Name Changing

From: StormeRider (silk@ICI.NET)
Date: 01/01/98

Well, got the primary bugs ironed out of the namechange function but
there's one minor problem. It changes it fine and saves the pfile, but
doesn't update the plr_index. I have tried calls to build_player_index and
save_player_index and neither of them work. Copied over and still can't log
in as the changed name.

Code below:
  struct char_data *vict;
  char *oldname;
  char arg1[MAX_STRING_LENGTH];
  char arg2[MAX_STRING_LENGTH];

  half_chop(argument, arg1, argument);
  half_chop(argument, arg2, argument);

  if ((!*arg1) || (!*arg2)) {
    send_to_char("Usage: namechange <character> <new name>\r\n", ch);

  if (!(vict = get_player_vis(ch, arg1, 0))) {
    send_to_char("They aren't here.\r\n", ch);

  if (GET_LEVEL(vict) > 5) {
    send_to_char("You can't change the name of someone over level 5.\r\n",

  sprintf(buf, "(GC) %s changed %s's name to %s.", IMM_NAME(ch),
GET_NAME(vict), arg2);
  mudlog(buf, BRF, LVL_IMMORT, TRUE);

  oldname = strdup(GET_NAME(vict));

  GET_NAME(vict) = strdup(arg2);
  save_char(vict, vict->in_room);
  send_to_charf(ch, "%s is now known as %s.\r\n", oldname, GET_NAME(vict));
  send_to_charf(vict, "%s has changed your name!\r\n", IMM_NAME(ch));
  send_to_roomf(vict->in_room, "%s is now known as %s.\r\n", oldname,

StormeRider                  ---                 --- telnet://

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

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