summaryrefslogtreecommitdiff
path: root/src/waypoint_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-26 14:10:57 +0000
committersmatz <smatz@openttd.org>2009-02-26 14:10:57 +0000
commitfaf959de6552625ef754cb8385bd1182907db4de (patch)
tree59d18ac6303f7accb510edb46008d9560a828869 /src/waypoint_gui.cpp
parente7c24792162329965cd5e8faee5dbb51212b778c (diff)
downloadopenttd-faf959de6552625ef754cb8385bd1182907db4de.tar.xz
(svn r15589) -Fix: drawing of waypoints with invalid owner was broken
-Change: don't take over waypoints without owner, it could belong to a bankrupted company (and the code was broken) - savegame conversion code is a bit more liberal now, too
Diffstat (limited to 'src/waypoint_gui.cpp')
-rw-r--r--src/waypoint_gui.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index f9cb86a00..91222f3ac 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -36,7 +36,7 @@ public:
WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
{
this->wp = GetWaypoint(this->window_number);
- this->owner = this->wp->owner;
+ if (this->wp->owner != OWNER_NONE) this->owner = this->wp->owner;
this->flags4 |= WF_DISABLE_VP_SCROLL;
InitializeWindowViewport(this, 3, 17, 254, 86, this->wp->xy, ZOOM_LVL_MIN);
@@ -53,6 +53,9 @@ public:
{
/* You can only change your own waypoints */
this->SetWidgetDisabledState(WAYPVW_RENAME, this->wp->owner != _local_company);
+ /* Disable the widget for waypoints with no owner (after company bankrupt) */
+ this->SetWidgetDisabledState(WAYPVW_SHOW_TRAINS, this->wp->owner == OWNER_NONE);
+
SetDParam(0, this->wp->index);
this->DrawWidgets();