summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-20 12:50:59 +0000
committerfrosch <frosch@openttd.org>2010-08-20 12:50:59 +0000
commit03ab15893590a53616e2d5f01570317c4fd20866 (patch)
tree7f3bf5fe95ac74839553ae6e39183310935d6a86 /src/station_cmd.cpp
parentde973a4d60ee2faf996a61a210e72d05f93640e2 (diff)
downloadopenttd-03ab15893590a53616e2d5f01570317c4fd20866.tar.xz
(svn r20579) -Change (r1579): Allow removing of buoys if they are only used by own vehicles.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 26a6cbd48..a8c7737fd 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2331,15 +2331,15 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
/**
* Tests whether the company's vehicles have this station in orders
- * When company == INVALID_COMPANY, then check all vehicles
* @param station station ID
- * @param company company ID, INVALID_COMPANY to disable the check
+ * @param include_company If true only check vehicles of \a company, if false only check vehicles of other companies
+ * @param company company ID
*/
-bool HasStationInUse(StationID station, CompanyID company)
+bool HasStationInUse(StationID station, bool include_company, CompanyID company)
{
const Vehicle *v;
FOR_ALL_VEHICLES(v) {
- if (company == INVALID_COMPANY || v->owner == company) {
+ if ((v->owner == company) == include_company) {
const Order *order;
FOR_VEHICLE_ORDERS(v, order) {
if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT)) && order->GetDestination() == station) {