Fix incorrect town distance sorting in scenario editor house picker town selector
See #628
This commit is contained in:
@@ -2192,7 +2192,7 @@ static void PlaceProc_House(TileIndex tile)
|
|||||||
|
|
||||||
if (towns.size() > 16 && _settings_client.scenario.house_ignore_zones == 2) {
|
if (towns.size() > 16 && _settings_client.scenario.house_ignore_zones == 2) {
|
||||||
std::sort(towns.begin(), towns.end(), [&](const TownID a, const TownID b) {
|
std::sort(towns.begin(), towns.end(), [&](const TownID a, const TownID b) {
|
||||||
return DistanceSquare(tile, Town::Get(a)->xy) < DistanceSquare(tile, Town::Get(a)->xy);
|
return DistanceSquare(tile, Town::Get(a)->xy) < DistanceSquare(tile, Town::Get(b)->xy);
|
||||||
});
|
});
|
||||||
towns.resize(16);
|
towns.resize(16);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user