Skip to content

Commit

Permalink
Fix empty city generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Apr 18, 2022
1 parent 735385b commit 6a10c8a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4971,17 +4971,20 @@ void overmap::place_cities()
tmp.size = size;
}
} else {
placement_attempts = 0;
tmp = random_entry( cities_to_place );
p = tripoint_om_omt( tmp.pos, 0 );
ter_set( tripoint_om_omt( tmp.pos, 0 ), oter_road_nesw );
}
cities.push_back( tmp );
const om_direction::type start_dir = om_direction::random();
om_direction::type cur_dir = start_dir;
if( placement_attempts == 0 ) {
cities.push_back( tmp );
const om_direction::type start_dir = om_direction::random();
om_direction::type cur_dir = start_dir;

do {
build_city_street( local_road, tmp.pos, tmp.size, cur_dir, tmp );
} while( ( cur_dir = om_direction::turn_right( cur_dir ) ) != start_dir );
do {
build_city_street( local_road, tmp.pos, tmp.size, cur_dir, tmp );
} while( ( cur_dir = om_direction::turn_right( cur_dir ) ) != start_dir );
}
}
}

Expand Down

0 comments on commit 6a10c8a

Please sign in to comment.