(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.

This commit is contained in:
frosch
2012-07-07 15:39:46 +00:00
parent ff95e3edaf
commit 358a2bd6ed
14 changed files with 55 additions and 63 deletions

View File

@@ -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) &&