diff options
author | rubidium <rubidium@openttd.org> | 2009-07-24 07:38:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-24 07:38:10 +0000 |
commit | 803cf87885aa8b6382996940d6418250889b678c (patch) | |
tree | 4ba316e76c8156146a7635f9694096ac30471a32 /src/base_station_base.h | |
parent | c1ffbc3bceafb9a0a47680dc28d010396924bc5c (diff) | |
download | openttd-803cf87885aa8b6382996940d6418250889b678c.tar.xz |
(svn r16934) -Codechange: introduce a simple helper function to check whether a station is pending deletion or not
Diffstat (limited to 'src/base_station_base.h')
-rw-r--r-- | src/base_station_base.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/base_station_base.h b/src/base_station_base.h index a4cbb2fc0..407370260 100644 --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -94,6 +94,17 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> { { return BaseStation::Get(GetStationIndex(tile)); } + + /** + * Check whether the base station currently is in use; in use means + * that it is not scheduled for deletion and that it still has some + * facilities left. + * @return true if still in use + */ + FORCEINLINE bool IsInUse() const + { + return (this->facilities & ~FACIL_WAYPOINT) != 0; + } }; #define FOR_ALL_BASE_STATIONS(var) FOR_ALL_ITEMS_FROM(BaseStation, station_index, var, 0) |