Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/aircraft_cmd.cpp # src/blitter/32bpp_anim.cpp # src/cargopacket.cpp # src/cheat_gui.cpp # src/company_cmd.cpp # src/company_gui.cpp # src/core/pool_func.hpp # src/date.cpp # src/economy.cpp # src/error_gui.cpp # src/ground_vehicle.cpp # src/ground_vehicle.hpp # src/group_gui.cpp # src/industry_cmd.cpp # src/lang/dutch.txt # src/lang/french.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/mcf.cpp # src/network/network_content.cpp # src/network/network_server.cpp # src/network/network_udp.cpp # src/newgrf_engine.cpp # src/newgrf_station.cpp # src/order_cmd.cpp # src/order_gui.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/yapf/yapf_common.hpp # src/saveload/saveload.cpp # src/settings_gui.cpp # src/station_cmd.cpp # src/station_kdtree.h # src/string_func.h # src/table/settings.ini # src/tgp.cpp # src/timetable_cmd.cpp # src/timetable_gui.cpp # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/train_gui.cpp # src/tree_gui.cpp # src/tunnelbridge_cmd.cpp # src/vehicle.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/video/sdl_v.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/viewport_sprite_sorter_sse4.cpp # src/window.cpp
This commit is contained in:
@@ -330,11 +330,11 @@ uint Station::GetCatchmentRadius() const
|
||||
uint ret = CA_NONE;
|
||||
|
||||
if (_settings_game.station.modified_catchment) {
|
||||
if (this->bus_stops != nullptr) ret = max<uint>(ret, CA_BUS);
|
||||
if (this->truck_stops != nullptr) ret = max<uint>(ret, CA_TRUCK);
|
||||
if (this->train_station.tile != INVALID_TILE) ret = max<uint>(ret, CA_TRAIN);
|
||||
if (this->ship_station.tile != INVALID_TILE) ret = max<uint>(ret, CA_DOCK);
|
||||
if (this->airport.tile != INVALID_TILE) ret = max<uint>(ret, this->airport.GetSpec()->catchment);
|
||||
if (this->bus_stops != nullptr) ret = std::max<uint>(ret, CA_BUS);
|
||||
if (this->truck_stops != nullptr) ret = std::max<uint>(ret, CA_TRUCK);
|
||||
if (this->train_station.tile != INVALID_TILE) ret = std::max<uint>(ret, CA_TRAIN);
|
||||
if (this->ship_station.tile != INVALID_TILE) ret = std::max<uint>(ret, CA_DOCK);
|
||||
if (this->airport.tile != INVALID_TILE) ret = std::max<uint>(ret, this->airport.GetSpec()->catchment);
|
||||
} else {
|
||||
if (this->bus_stops != nullptr || this->truck_stops != nullptr || this->train_station.tile != INVALID_TILE || this->ship_station.tile != INVALID_TILE || this->airport.tile != INVALID_TILE) {
|
||||
ret = CA_UNMODIFIED;
|
||||
@@ -356,10 +356,10 @@ Rect Station::GetCatchmentRectUsingRadius(uint catchment_radius) const
|
||||
|
||||
/* Compute acceptance rectangle */
|
||||
Rect ret = {
|
||||
max<int>(this->rect.left - catchment_radius, 0),
|
||||
max<int>(this->rect.top - catchment_radius, 0),
|
||||
min<int>(this->rect.right + catchment_radius, MapMaxX()),
|
||||
min<int>(this->rect.bottom + catchment_radius, MapMaxY())
|
||||
std::max<int>(this->rect.left - catchment_radius, 0),
|
||||
std::max<int>(this->rect.top - catchment_radius, 0),
|
||||
std::min<int>(this->rect.right + catchment_radius, MapMaxX()),
|
||||
std::min<int>(this->rect.bottom + catchment_radius, MapMaxY())
|
||||
};
|
||||
|
||||
return ret;
|
||||
@@ -555,7 +555,7 @@ CommandCost StationRect::BeforeAddTile(TileIndex tile, StationRectMode mode)
|
||||
} else if (!this->PtInExtendedRect(x, y)) {
|
||||
/* current rect is not empty and new point is outside this rect
|
||||
* make new spread-out rectangle */
|
||||
Rect new_rect = {min(x, this->left), min(y, this->top), max(x, this->right), max(y, this->bottom)};
|
||||
Rect new_rect = {std::min(x, this->left), std::min(y, this->top), std::max(x, this->right), std::max(y, this->bottom)};
|
||||
|
||||
/* check new rect dimensions against preset max */
|
||||
int w = new_rect.right - new_rect.left + 1;
|
||||
|
Reference in New Issue
Block a user