summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-02-13 15:42:52 +0000
committercelestar <celestar@openttd.org>2007-02-13 15:42:52 +0000
commit8eab3964b4ad7ebe0151aa292d42d74400214f4a (patch)
tree97f07e8c9bbb7b74d420386b638d4c6d8944d7a7 /src/station.cpp
parent6f68ac46b8c603b23123b5d899afa6988836f497 (diff)
downloadopenttd-8eab3964b4ad7ebe0151aa292d42d74400214f4a.tar.xz
(svn r8707) -Codechange: Turn IsValidStation into a method of Station
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 296a974fd..1f72df7ba 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -162,7 +162,7 @@ bool Station::TileBelongsToRailStation(TileIndex tile) const
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
* TODO - This is just a temporary stage, this will be removed. */
for (st = GetStation(0); st != NULL; st = (st->index + 1U < GetStationPoolSize()) ? GetStation(st->index + 1U) : NULL) {
- if (!IsValidStation(st)) {
+ if (!st->IsValid()) {
StationID index = st->index;
memset(st, 0, sizeof(Station));
@@ -187,6 +187,14 @@ bool Station::IsBuoy() const
return (this->had_vehicle_of_type & HVOT_BUOY) != 0;
}
+/** Determines whether a station exists
+ * @todo replace 0 by INVALID_TILE
+ */
+bool Station::IsValid() const
+{
+ return xy != 0;
+}
+
/************************************************************************/
/* StationRect implementation */