diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-07-26 22:17:17 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-07-26 22:17:17 +0000 |
commit | 5f8d27519c76fd297eb61144ff38bd5d1afa51bb (patch) | |
tree | a5d6b25dde80921fd7358dbb4b8a675f567465b3 | |
parent | abe68923dd00e7585914352fa5fe0cb32bda5697 (diff) |
Keep the list of rooms compacted
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@175 84d2e878-0bd5-11dd-ad15-13eda11d74c5
-rw-r--r-- | src/game.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; i<game->num_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; j<game->num_rooms-1; j++ ) { + game->rooms[j] = game->rooms[j+1]; + } + game->num_rooms--; } } |