[Newbie] [Code]

From: Lars Juul (larsjuul@post2.tele.dk)
Date: 12/26/96


First merry christmas to all :)

I guess this is a newbie question to you all .... I trying to impl. a
remort system and come
up with following code and it actually works *smile*
I would like some comment from you all ... it is a good way to do it or is
there a better/smarter
way ? "aren't there always *grin*"

Greetings from a happy Dane
=====================

  struct descriptor_data *d, *next_d;
  char player_name[MAX_INPUT_LENGTH];
  char player_pwd[MAX_PWD_LENGTH];

  if (IS_NPC(ch) || !ch->desc)
    return;

  for (d = descriptor_list; d; d = next_d) {
    next_d = d->next;
    if (d->character && (GET_IDNUM(d->character) == GET_IDNUM(ch)))
    {
      sprintf(player_name, "%s", ch->player.name);
      sprintf(player_pwd, "%s", GET_PASSWD(d->character));

      SET_BIT(PLR_FLAGS(ch), PLR_REMORT);
      extract_char(ch);

      free_char(d->character);
      CREATE(d->character, struct char_data, 1);
      clear_char(d->character);
      CREATE(d->character->player_specials, struct player_special_data, 1);
      d->character->desc = d;
      CREATE(d->character->player.name, char, strlen(player_name) + 1);
      strcpy(d->character->player.name, CAP(player_name));

      strncpy(GET_PASSWD(d->character), player_pwd, MAX_PWD_LENGTH);

      STATE(d) = CON_REMORT;
      return;
    }
  }
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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