summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-07-07 15:39:46 +0000
committerfrosch <frosch@openttd.org>2012-07-07 15:39:46 +0000
commit08a8c3a773e9c730bd92a39e1e07403a172e866a (patch)
tree5fea4034f5d65bf6be9c28458ce05369d702a78d /src/ship_cmd.cpp
parent8d004f3c63fbff4f3524f770483db90408a98c50 (diff)
downloadopenttd-08a8c3a773e9c730bd92a39e1e07403a172e866a.tar.xz
(svn r24384) -Fix [FS#5188-ish]: Make IsInDepot() functions behave consistent across vehicle types and add IsChainInDepot instead, if that is what shall be checked.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 6b6ec4715..ed43cf7d2 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -142,7 +142,7 @@ static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance)
static void CheckIfShipNeedsService(Vehicle *v)
{
if (Company::Get(v->owner)->settings.vehicle.servint_ships == 0 || !v->NeedsAutomaticServicing()) return;
- if (v->IsInDepot()) {
+ if (v->IsChainInDepot()) {
VehicleServiceInDepot(v);
return;
}
@@ -298,7 +298,7 @@ static const TileIndexDiffC _ship_leave_depot_offs[] = {
static bool CheckShipLeaveDepot(Ship *v)
{
- if (!v->IsInDepot()) return false;
+ if (!v->IsChainInDepot()) return false;
/* We are leaving a depot, but have to go to the exact same one; re-enter */
if (v->current_order.IsType(OT_GOTO_DEPOT) &&