summaryrefslogtreecommitdiff
path: root/src/waypoint_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-10-21 19:16:47 +0000
committerrubidium <rubidium@openttd.org>2014-10-21 19:16:47 +0000
commite811fa1718af11e683b4d2f20e6f62a2cd004821 (patch)
tree3d607f1a810193ef509d90fd01751ddad086072f /src/waypoint_gui.cpp
parent96c321e9588dd0548f01e19e91fbe545e003480e (diff)
downloadopenttd-e811fa1718af11e683b4d2f20e6f62a2cd004821.tar.xz
(svn r27030) -Fix: crash when having the vehicle list opened from a buoy or oil rig while the buoy/oil rig gets its final removal (i.e. the sign gets removed)
Diffstat (limited to 'src/waypoint_gui.cpp')
-rw-r--r--src/waypoint_gui.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index 3400a7df4..fa4deaac6 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -67,7 +67,7 @@ public:
}
this->FinishInitNested(window_number);
- if (this->wp->owner != OWNER_NONE) this->owner = this->wp->owner;
+ this->owner = this->wp->owner;
this->flags |= WF_DISABLE_VP_SCROLL;
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_W_VIEWPORT);
@@ -78,13 +78,7 @@ 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;
-
- /* Well, spectators otoh */
- if (Company::IsValidID(owner)) DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, owner, this->window_number).Pack(), false);
+ DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, this->owner, this->window_number).Pack(), false);
}
virtual void SetStringParameters(int widget) const