summaryrefslogtreecommitdiff
path: root/src/base_station_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-24 07:38:10 +0000
committerrubidium <rubidium@openttd.org>2009-07-24 07:38:10 +0000
commit803cf87885aa8b6382996940d6418250889b678c (patch)
tree4ba316e76c8156146a7635f9694096ac30471a32 /src/base_station_base.h
parentc1ffbc3bceafb9a0a47680dc28d010396924bc5c (diff)
downloadopenttd-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.h11
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)