it will go into an infinite loop when you next act() in the new room. This is because the *people
variable also gets copied. So when you "goto <new room>" you are already IN that room, and it
sets your 'next_in_room' to yourself, and when it tries to do your poof_in via act(), it is in an
infinite loop here:
for (; to; to = to->next_in_room) {
if (!SENDOK(to) || (to == ch))
continue;
as you are both to, and to->next_in_room.
Maybe adding to the act() function:
for (; to; to = to->next_in_room) {
+ if(to == to->next_in_room)
+ break;
if (!SENDOK(to) || (to == ch))
continue;
Might prevent any other places that might accidently cause this to not freeze the game. I realize its more of a hack then fixing the problem, but *shrug*
I fixed this by adding the following to the redit_setup_exisiting() function in redit:
void redit_setup_existing(struct descriptor_data *d, int real_num)
{
struct room_data *room;
int counter;
/* Build a copy of the room for editing. */
CREATE(room, struct room_data, 1);
*room = world[real_num];
+ /* Make new room people list be empty. */
+ /* Fixes bug where copying a room from within that room creates */
+ /* an infinite loop when you next act() in the new room (goto?) */
+ /* and you are your next_in_room -- anderyu (10-05-22) */
+ room->people = NULL;
+
/* Allocate space for all strings. */
room->name = str_udup(world[real_num].name);
room->description = str_udup(world[real_num].description);
If there is a more proper way to prevent this from being copied instead of just
resetting it after the fact I'm interested in that.
anderyu



