diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -162,8 +162,8 @@ static void game_delete_room(Game *game, int idx) { free(room); /* Shift the list up one place */ - for ( i=idx+1; i<game->num_rooms; i++ ) { - game->rooms[i-1] = game->rooms[i]; + for ( i=idx; i<game->num_rooms-1; i++ ) { + game->rooms[i] = game->rooms[i+1]; } game->num_rooms--; @@ -256,14 +256,9 @@ 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--; } } |