summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-09 10:55:05 +0000
committerrubidium <rubidium@openttd.org>2010-09-09 10:55:05 +0000
commit64d9a36dc08d8a6113af25d08446ac47afc4e18e (patch)
treebf759e87a9dde1f71fa11d66a4b8b6ddd783f58f /src
parent4b605f51abceef248c0197bf3c67091d8cafcdeb (diff)
downloadopenttd-64d9a36dc08d8a6113af25d08446ac47afc4e18e.tar.xz
(svn r20774) -Fix [FS#4116]: assertion triggered when removing a station owned by nobody when the local company is "spectator" as well
Diffstat (limited to 'src')
-rw-r--r--src/station.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 70deb7de4..956dde1ab 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -40,6 +40,7 @@ BaseStation::~BaseStation()
Owner owner = this->owner;
if (!Company::IsValidID(owner)) owner = _local_company;
+ if (!Company::IsValidID(owner)) return; // Spectators
DeleteWindowById(WC_TRAINS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_TRAIN, owner, this->index).Pack());
DeleteWindowById(WC_ROADVEH_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_ROAD, owner, this->index).Pack());
DeleteWindowById(WC_SHIPS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_SHIP, owner, this->index).Pack());