Merge branch 'master' into jgrpp
# Conflicts: # config.lib # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/aircraft_cmd.cpp # src/base_station_base.h # src/core/pool_type.hpp # src/disaster_vehicle.cpp # src/economy.cpp # src/engine.cpp # src/group.h # src/group_cmd.cpp # src/group_gui.cpp # src/lang/english.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/network/network_command.cpp # src/network/network_server.cpp # src/openttd.cpp # src/order_cmd.cpp # src/road_cmd.cpp # src/saveload/afterload.cpp # src/saveload/cargopacket_sl.cpp # src/saveload/linkgraph_sl.cpp # src/saveload/order_sl.cpp # src/saveload/station_sl.cpp # src/saveload/town_sl.cpp # src/saveload/vehicle_sl.cpp # src/screenshot.cpp # src/screenshot.h # src/settings_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/station.cpp # src/station_cmd.cpp # src/table/settings.ini # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train.h # src/train_cmd.cpp # src/train_gui.cpp # src/vehicle.cpp # src/vehicle_base.h # src/vehiclelist.cpp # src/window_type.h
This commit is contained in:
@@ -44,8 +44,7 @@ StationKdtree _station_kdtree(Kdtree_StationXYFunc);
|
||||
void RebuildStationKdtree()
|
||||
{
|
||||
std::vector<StationID> stids;
|
||||
BaseStation *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
for (const Station *st : Station::Iterate()) {
|
||||
stids.push_back(st->index);
|
||||
}
|
||||
_station_kdtree.Build(stids.begin(), stids.end());
|
||||
@@ -100,8 +99,7 @@ Station::~Station()
|
||||
this->loading_vehicles.front()->LeaveStation();
|
||||
}
|
||||
|
||||
Aircraft *a;
|
||||
FOR_ALL_AIRCRAFT(a) {
|
||||
for (Aircraft *a : Aircraft::Iterate()) {
|
||||
if (!a->IsNormalAircraft()) continue;
|
||||
if (a->targetairport == this->index) a->targetairport = INVALID_STATION;
|
||||
}
|
||||
@@ -125,8 +123,7 @@ Station::~Station()
|
||||
}
|
||||
}
|
||||
|
||||
Vehicle *v;
|
||||
FOR_ALL_VEHICLES(v) {
|
||||
for (Vehicle *v : Vehicle::Iterate()) {
|
||||
/* Forget about this station if this station is removed */
|
||||
if (v->last_station_visited == this->index) {
|
||||
v->last_station_visited = INVALID_STATION;
|
||||
@@ -400,10 +397,8 @@ static void AddIndustryToDeliver(Industry *ind, Station *st)
|
||||
*/
|
||||
void Station::RemoveFromAllNearbyLists()
|
||||
{
|
||||
Town *t;
|
||||
FOR_ALL_TOWNS(t) { t->stations_near.erase(this); }
|
||||
Industry *i;
|
||||
FOR_ALL_INDUSTRIES(i) { i->stations_near.erase(this); }
|
||||
for (Town *t : Town::Iterate()) { t->stations_near.erase(this); }
|
||||
for (Industry *i : Industry::Iterate()) { i->stations_near.erase(this); }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -496,12 +491,9 @@ void Station::RecomputeCatchment(bool no_clear_nearby_lists)
|
||||
*/
|
||||
/* static */ void Station::RecomputeCatchmentForAll()
|
||||
{
|
||||
Town *t;
|
||||
FOR_ALL_TOWNS(t) { t->stations_near.clear(); }
|
||||
Industry *i;
|
||||
FOR_ALL_INDUSTRIES(i) { i->stations_near.clear(); }
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) { st->RecomputeCatchment(true); }
|
||||
for (Town *t : Town::Iterate()) { t->stations_near.clear(); }
|
||||
for (Industry *i : Industry::Iterate()) { i->stations_near.clear(); }
|
||||
for (Station *st : Station::Iterate()) { st->RecomputeCatchment(true); }
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@@ -680,8 +672,7 @@ Money AirportMaintenanceCost(Owner owner)
|
||||
{
|
||||
Money total_cost = 0;
|
||||
|
||||
const Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
for (const Station *st : Station::Iterate()) {
|
||||
if (st->owner == owner && (st->facilities & FACIL_AIRPORT)) {
|
||||
total_cost += _price[PR_INFRASTRUCTURE_AIRPORT] * st->airport.GetSpec()->maintenance_cost;
|
||||
}
|
||||
|
Reference in New Issue
Block a user