From 5f8d27519c76fd297eb61144ff38bd5d1afa51bb Mon Sep 17 00:00:00 2001 From: taw27 Date: Sat, 26 Jul 2008 22:17:17 +0000 Subject: Keep the list of rooms compacted git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@175 84d2e878-0bd5-11dd-ad15-13eda11d74c5 --- src/game.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game.c b/src/game.c index 1881004..edf8a7d 100644 --- a/src/game.c +++ b/src/game.c @@ -256,9 +256,14 @@ static void game_load_all_relevant(Game *game) { /* Remove any rooms left in the list which are no longer needed */ for ( i=0; inum_rooms; i++ ) { if ( !game->rooms[i]->needed_this_time ) { + int j; if ( game->debug ) printf("GM: %2i %2i %2i is no longer needed\n", game->rooms[i]->rx, game->rooms[i]->ry, game->rooms[i]->rz); game_delete_room(game, i); + for ( j=i; jnum_rooms-1; j++ ) { + game->rooms[j] = game->rooms[j+1]; + } + game->num_rooms--; } } -- cgit v1.2.3