Oasis Room save bug

From: Kras Kresh (kras_kresh@hotmail.com)
Date: 03/24/02


I've tracked down the bug of putting someone in two rooms after saving in
redit, but I'm not sure how to fix it. While in redit, someone leaves the
room. However, when the immortal starts redit, the in_room people list is
saved so the someone that left the room didn't completely leave.

When the immortal leaves redit, redit_save_internally() will call add_room()
which in turn calls copy_room(). copy_room() is passed the room he is in and
the room it will become.

int copy_room(struct room_data *to, struct room_data *from)
{
  free_room_strings(to);
  *to = *from;
  copy_room_strings(to, from);

  /* Don't put people and objects in two locations.
     Am thinking this shouldn't be done here... */
  from->people = NULL;
  from->contents = NULL;
}

When *to = *from is used, the old people list becomes the new people list in
the room and so will the room contents.

I can only think of two solutions.. in char_from_room() and obj_from_room(),
we traverse the people in room list and obj in room list and look for
players in redit and remove them from the list. Of course, we would also
have to make checks in other places if we added features like tornadoes.
Where the tornado time lowers, it would have to traverse the people list for
redit people and lower it from their temp room too.

.... or in copy_room() we create a list of the current people/objects in the
room, save it to an object, and attach it to *to after the *to = *from call.
Of course, we would also have to check for other things, such as if someone
puts a tornado in the room, we'd have to check for how much longer it would
last.

Which one will be better, or is there a third or fourth choice?


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT