From 0566b29ab7af463d815b67b05cff638423b68b98 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 12 Nov 2012 18:11:26 +0000 Subject: (svn r24708) -Codechange: Check magic values of GoodsEntry::last_speed only via wrapper function. --- src/station_base.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/station_base.h') diff --git a/src/station_base.h b/src/station_base.h index dcfc51418..5f179eb32 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -107,6 +107,13 @@ struct GoodsEntry { byte amount_fract; ///< Fractional part of the amount in the cargo list StationCargoList cargo; ///< The cargo packets of cargo waiting in this station + + /** + * Reports whether a vehicle has ever tried to load the cargo at this station. + * This does not imply that there was cargo available for loading. Refer to GES_PICKUP for that. + * @return true if vehicle tried to load. + */ + bool HasVehicleEverTriedLoading() const { return this->last_speed != 0; } }; /** All airport-related information. Only valid if tile != INVALID_TILE. */ -- cgit v1.2.3-54-g00ecf