mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r21035) -Fix [FS#4181] (r21020): crash when opening the buoy's viewport. Based on a patch by Krille.
This commit is contained in:
parent
0568976c78
commit
1f5554c5c7
|
@ -46,7 +46,11 @@ private:
|
||||||
*/
|
*/
|
||||||
TileIndex GetCenterTile() const
|
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:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue