diff options
author | frosch <frosch@openttd.org> | 2010-01-04 19:42:29 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-01-04 19:42:29 +0000 |
commit | 1ed599f5cf6a0dec14d91d5442a08560e254d35c (patch) | |
tree | 969762c9812a05d4cc85ffc522779bbc7667496a /src/ai/api/ai_waypointlist.cpp | |
parent | 27fc22a76bf470c2088a38d57d9cd2a8e481cafb (diff) | |
download | openttd-1ed599f5cf6a0dec14d91d5442a08560e254d35c.tar.xz |
(svn r18725) -Add: [NoAI] AIWaypoint::WaypointType and AIWaypoint::HasWaypointType().
-Change: [NoAI] Constructor of AIWaypoint now takes a WaypointType to also handle buoys.
-Remove: [NoAI] AIBuoyList.
Diffstat (limited to 'src/ai/api/ai_waypointlist.cpp')
-rw-r--r-- | src/ai/api/ai_waypointlist.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ai/api/ai_waypointlist.cpp b/src/ai/api/ai_waypointlist.cpp index 13087df81..79cc62fdf 100644 --- a/src/ai/api/ai_waypointlist.cpp +++ b/src/ai/api/ai_waypointlist.cpp @@ -15,11 +15,12 @@ #include "../../vehicle_base.h" #include "../../waypoint_base.h" -AIWaypointList::AIWaypointList() +AIWaypointList::AIWaypointList(AIWaypoint::WaypointType waypoint_type) { const Waypoint *wp; FOR_ALL_WAYPOINTS(wp) { - if (wp->facilities & FACIL_TRAIN && wp->owner == _current_company) this->AddItem(wp->index); + if ((wp->facilities & waypoint_type) && + (wp->owner == _current_company || wp->owner == OWNER_NONE)) this->AddItem(wp->index); } } |