summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
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/station_cmd.cpp
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/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index c9fc22cba..5854ba489 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2570,7 +2570,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
*/
static bool StationHandleBigTick(BaseStation *st)
{
- if ((st->facilities & ~FACIL_WAYPOINT) == 0 && ++st->delete_ctr >= 8) {
+ if (!st->IsInUse() && ++st->delete_ctr >= 8) {
delete st;
return false;
}
@@ -2698,7 +2698,7 @@ static void UpdateStationRating(Station *st)
/* called for every station each tick */
static void StationHandleSmallTick(BaseStation *st)
{
- if ((st->facilities & FACIL_WAYPOINT) != 0 || st->facilities == 0) return;
+ if ((st->facilities & FACIL_WAYPOINT) != 0 || !st->IsInUse()) return;
byte b = st->delete_ctr + 1;
if (b >= 185) b = 0;