Skip to content

Commit a88d874

Browse files
committed
FIX: count instead dir
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11705 8aca7d54-2c30-db11-9de9-000461428c89
1 parent 183e715 commit a88d874

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/simutrans/world/simcity.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,14 +2960,16 @@ int stadt_t::orient_city_building(const koord k, const building_desc_t *h, koord
29602960
// now find the two sides with most streets around
29612961
int largest_dir_count = -9999, largest_2nd_count = -9999;
29622962
int largest_dir = -1, largest_2nd_dir = -1;
2963-
for (int i = 0; i < 4; i++) {
2963+
for (int i = 0; i < lengthof(streetdir); i++) {
29642964
if (streetdir[i] >= largest_dir_count) {
2965-
largest_2nd_dir = largest_dir_count;
2965+
largest_2nd_count = largest_dir_count;
2966+
largest_2nd_dir = largest_dir;
29662967
largest_dir_count = streetdir[i];
29672968
largest_dir = i;
29682969
}
29692970
else if (largest_2nd_count == -1 && streetdir[i] > 0) {
29702971
largest_2nd_dir = i;
2972+
largest_2nd_count = streetdir[i];
29712973
}
29722974
}
29732975

0 commit comments

Comments
 (0)