Changeset - r13004:7de4c6068404
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2009-09-12 12:56:49
rubidium@openttd.org
(svn r17508) -Fix [FS#3195] (r16859): join station window didn't get updated when stations were removed from the pool
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/base_station_base.h
Show inline comments
 
@@ -149,24 +149,26 @@ struct BaseStation : StationPool::PoolIt
 
	}
 

	
 
	/**
 
	 * 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;
 
	}
 

	
 
	static void PostDestructor(size_t index);
 
};
 

	
 
#define FOR_ALL_BASE_STATIONS(var) FOR_ALL_ITEMS_FROM(BaseStation, station_index, var, 0)
 

	
 
/**
 
 * Class defining several overloaded accessors so we don't
 
 * have to cast base stations that often
 
 */
 
template <class T, bool Tis_waypoint>
 
struct SpecializedStation : public BaseStation {
 
	static const StationFacility EXPECTED_FACIL = Tis_waypoint ? FACIL_WAYPOINT : FACIL_NONE; ///< Specialized type
 

	
src/station.cpp
Show inline comments
 
@@ -107,25 +107,25 @@ Station::~Station()
 
	FOR_ALL_CARGOPACKETS(cp) {
 
		/* Don't allow cargo packets with invalid source station */
 
		if (cp->source == this->index) cp->source = INVALID_STATION;
 
	}
 
}
 

	
 

	
 
/**
 
 * Invalidating of the JoinStation window has to be done
 
 * after removing item from the pool.
 
 * @param index index of deleted item
 
 */
 
void Station::PostDestructor(size_t index)
 
void BaseStation::PostDestructor(size_t index)
 
{
 
	InvalidateWindowData(WC_SELECT_STATION, 0, 0);
 
}
 

	
 
/**
 
 * Get the primary road stop (the first road stop) that the given vehicle can load/unload.
 
 * @param v the vehicle to get the first road stop for
 
 * @return the first roadstop that this vehicle can load at
 
 */
 
RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const
 
{
 
	RoadStop *rs = this->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK);
src/station_base.h
Show inline comments
 
@@ -110,19 +110,17 @@ public:
 

	
 
	uint GetCatchmentRadius() const;
 
	Rect GetCatchmentRect() const;
 

	
 
	/* virtual */ FORCEINLINE bool TileBelongsToRailStation(TileIndex tile) const
 
	{
 
		return IsRailStationTile(tile) && GetStationIndex(tile) == this->index;
 
	}
 

	
 
	/* virtual */ uint32 GetNewGRFVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) const;
 

	
 
	/* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
 

	
 
	static void PostDestructor(size_t index);
 
};
 

	
 
#define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)
 

	
 
#endif /* STATION_BASE_H */
0 comments (0 inline, 0 general)