Update to 1.10.0-beta2
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
@@ -44,8 +42,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 +97,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 +121,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;
|
||||
@@ -164,7 +159,7 @@ Station::~Station()
|
||||
CargoPacket::InvalidateAllFrom(this->index);
|
||||
|
||||
_station_kdtree.Remove(this->index);
|
||||
_viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(this->index));
|
||||
if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(this->index));
|
||||
}
|
||||
|
||||
|
||||
@@ -386,10 +381,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); }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -482,8 +475,7 @@ void Station::RecomputeCatchment()
|
||||
*/
|
||||
/* static */ void Station::RecomputeCatchmentForAll()
|
||||
{
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) { st->RecomputeCatchment(); }
|
||||
for (Station *st : Station::Iterate()) { st->RecomputeCatchment(); }
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@@ -662,8 +654,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