diff options
author | rubidium <rubidium@openttd.org> | 2009-07-25 10:39:58 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-25 10:39:58 +0000 |
commit | 4017439c37e661dbd694771106a8b29e9b860137 (patch) | |
tree | 246f39008b2a605aea760da2827bc586dedc2f87 /src/station_cmd.cpp | |
parent | 7440ec7a7350051297439f58f30d63f02018a507 (diff) | |
download | openttd-4017439c37e661dbd694771106a8b29e9b860137.tar.xz |
(svn r16948) -Codechange: some code reductions and usage of wrapper functions
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6f53d1420..e5d021597 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -352,7 +352,7 @@ static Station *GetClosestDeletedStation(TileIndex tile) Station *st; FOR_ALL_STATIONS(st) { - if (st->facilities == 0 && st->owner == _current_company) { + if (!st->IsInUse() && st->owner == _current_company) { uint cur_dist = DistanceManhattan(tile, st->xy); if (cur_dist < threshold) { @@ -420,11 +420,7 @@ void UpdateAllStationVirtCoords() { BaseStation *st; - FOR_ALL_STATIONS(st) { - st->UpdateVirtCoord(); - } - - FOR_ALL_WAYPOINTS(st) { + FOR_ALL_BASE_STATIONS(st) { st->UpdateVirtCoord(); } } @@ -628,7 +624,7 @@ static void UpdateStationSignCoord(Station *st) */ static void DeleteStationIfEmpty(Station *st) { - if (st->facilities == 0) { + if (!st->IsInUse()) { st->delete_ctr = 0; InvalidateWindowData(WC_STATION_LIST, st->owner, 0); } @@ -2951,7 +2947,7 @@ void DeleteOilRig(TileIndex tile) st->UpdateVirtCoord(); st->RecomputeIndustriesNear(); - if (st->facilities == 0) delete st; + if (!st->IsInUse()) delete st; } static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_owner) |