Changeset - r16317:c87cb97b6914
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-10-24 20:59:25
rubidium@openttd.org
(svn r21035) -Fix [FS#4181] (r21020): crash when opening the buoy's viewport. Based on a patch by Krille.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/waypoint_gui.cpp
Show inline comments
 
@@ -43,13 +43,17 @@ private:
 
	/**
 
	 * Get the center tile of the waypoint.
 
	 * @return The center tile if the waypoint exists, otherwise the tile with the waypoint name.
 
	 */
 
	TileIndex GetCenterTile() const
 
	{
 
		return this->wp->IsInUse() ? this->wp->train_station.GetCenterTile() : this->wp->xy;
 
		if (!this->wp->IsInUse()) return this->wp->xy;
 

	
 
		TileArea ta;
 
		this->wp->GetTileArea(&ta, this->vt == VEH_TRAIN ? STATION_WAYPOINT : STATION_BUOY);
 
		return ta.GetCenterTile();
 
	}
 

	
 
public:
 
	WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
 
	{
 
		this->wp = Waypoint::Get(window_number);
0 comments (0 inline, 0 general)