changeset 16081:8515224705be draft

(svn r20774) -Fix [FS#4116]: assertion triggered when removing a station owned by nobody when the local company is "spectator" as well
author rubidium <rubidium@openttd.org>
date Thu, 09 Sep 2010 10:55:05 +0000
parents d9c56fa41847
children f12dbf5b5fa0
files src/station.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -40,6 +40,7 @@
 
 	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());