summaryrefslogtreecommitdiff
path: root/src/waypoint_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-24 07:38:10 +0000
committerrubidium <rubidium@openttd.org>2009-07-24 07:38:10 +0000
commit803cf87885aa8b6382996940d6418250889b678c (patch)
tree4ba316e76c8156146a7635f9694096ac30471a32 /src/waypoint_gui.cpp
parentc1ffbc3bceafb9a0a47680dc28d010396924bc5c (diff)
downloadopenttd-803cf87885aa8b6382996940d6418250889b678c.tar.xz
(svn r16934) -Codechange: introduce a simple helper function to check whether a station is pending deletion or not
Diffstat (limited to 'src/waypoint_gui.cpp')
-rw-r--r--src/waypoint_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index bfe3f04e9..46478505c 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -59,9 +59,9 @@ public:
virtual void OnPaint()
{
/* You can only change your own waypoints */
- this->SetWidgetDisabledState(WAYPVW_RENAME, (this->wp->facilities & ~FACIL_WAYPOINT) == 0 || (this->wp->owner != _local_company && this->wp->owner != OWNER_NONE));
- /* Disable the widget for waypoints with no owner (after company bankrupt) */
- this->SetWidgetDisabledState(WAYPVW_SHOW_VEHICLES, (this->wp->facilities & ~FACIL_WAYPOINT) == 0);
+ this->SetWidgetDisabledState(WAYPVW_RENAME, !this->wp->IsInUse() || (this->wp->owner != _local_company && this->wp->owner != OWNER_NONE));
+ /* Disable the widget for waypoints with no use */
+ this->SetWidgetDisabledState(WAYPVW_SHOW_VEHICLES, !this->wp->IsInUse());
SetDParam(0, this->wp->index);
this->DrawWidgets();