summaryrefslogtreecommitdiff
path: root/src/waypoint_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-02-23 18:39:56 +0000
committerfrosch <frosch@openttd.org>2011-02-23 18:39:56 +0000
commitfacf400d2711f8114512203d609ecc274611000d (patch)
tree380ec7e0d1d86547fbbb6e6c2c20896a6afaa092 /src/waypoint_gui.cpp
parent678cf3553f8d8728ac7dd43603df92a0c92952b5 (diff)
downloadopenttd-facf400d2711f8114512203d609ecc274611000d.tar.xz
(svn r22131) -Fix: Spectators had trouble closing buoy windows. (Terkhen)
Diffstat (limited to 'src/waypoint_gui.cpp')
-rw-r--r--src/waypoint_gui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index f050b3c26..23c9781e3 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -79,8 +79,12 @@ public:
~WaypointWindow()
{
Owner owner = this->owner;
+
+ /* Buoys have no owner and can be used by everyone. Show only 'our' vehicles */
if (!Company::IsValidID(owner)) owner = _local_company;
- DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, owner, this->window_number).Pack(), false);
+
+ /* Well, spectators otoh */
+ if (Company::IsValidID(owner)) DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, owner, this->window_number).Pack(), false);
}
virtual void SetStringParameters(int widget) const