player index bug

From: Michael Buselli (mhbusell@midway.uchicago.edu)
Date: 04/06/95


Hello,

     I found a bug concerning the player index.  When a new character is
created with the same name as an old deleted character, the player table
is not updated correctly.  It changes the id number of the last entry in
the table to the new character's idnum instead of assigning that idnum to
the new player's entry in the table.

     I fixed this by going into init_char in db.c and fixing the part 
where the player_table id number is assigned to:

  for (i = 0; i <= top_of_p_table; i++)
    if (!str_cmp((player_table + i)->name, GET_NAME(ch)))
      (player_table + i)->id = GET_IDNUM(ch) = ++top_idnum;

     I tried some other solutions, but this one looked the most sound 
one that was easy to do.  If you have a better solution, tell me! :)

Michael Buselli



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