Re: [CODE] Deleting a room

From: Andrew (object@alphalink.com.au)
Date: 01/06/99


>http://www.circlemud.org/~greerga/oasis2.pre.tar.gz
>
>        genwld.c: delete_room()
>
>Have to remove the save list line though.

Thanks all the same, but I'm not going to get anywhere fast just by copying
your code and putting into the source of my mud. I have narrowed down the
problem however. If you delete a room, that room is deleted, but so are all
the ones above it. Eg, if you delete room #5, room 5,6,7,8 etc. are deleted,
whioch is not what I want. So I assume the problem is copying over the world
struct to the temp struct... here's the code:

num_of_rooms--;

CREATE(temp, struct room_data, num_of_rooms);

for(i = 0, y = 0; i < num_of_rooms; )
{
        if (world[i].number != room) {
                temp[y] = world[i];
                i++;
                y++;
        }
        else {
                i++;
                continue;
        }
}

Does this look to be the source of the problem? Once again, any help would
be appreciated.

George: I've looked at your delete_room code, and it's very good I'm sure,
but I like to do things my own way. Hope you understand. Thanks for your
help anyhow.

Cheers,

----
Andrew Ritchie,
object@alphalink.com.au


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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