aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-07-26 22:17:17 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-07-26 22:17:17 +0000
commit5f8d27519c76fd297eb61144ff38bd5d1afa51bb (patch)
treea5d6b25dde80921fd7358dbb4b8a675f567465b3 /src
parentabe68923dd00e7585914352fa5fe0cb32bda5697 (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
Diffstat (limited to 'src')
-rw-r--r--src/game.c5
1 files changed, 5 insertions, 0 deletions
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; 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--;
}
}