Merge branch 'master' into jgrpp

# Conflicts:
#	src/depot_type.h
#	src/lang/german.txt
#	src/order_gui.cpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/script/api/script_window.hpp.in
#	src/settings_table.cpp
#	src/train_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2022-11-05 17:18:01 +00:00
23 changed files with 233 additions and 155 deletions

View File

@@ -871,7 +871,7 @@ void OrderList::DebugCheckSanity() const
static inline bool OrderGoesToStation(const Vehicle *v, const Order *o)
{
return o->IsType(OT_GOTO_STATION) ||
(v->type == VEH_AIRCRAFT && o->IsType(OT_GOTO_DEPOT) && !(o->GetDepotActionType() & ODATFB_NEAREST_DEPOT));
(v->type == VEH_AIRCRAFT && o->IsType(OT_GOTO_DEPOT) && o->GetDestination() != INVALID_STATION);
}
/**
@@ -917,7 +917,7 @@ TileIndex Order::GetLocation(const Vehicle *v, bool airport) const
return BaseStation::Get(this->GetDestination())->xy;
case OT_GOTO_DEPOT:
if ((this->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) return INVALID_TILE;
if (this->GetDestination() == INVALID_DEPOT) return INVALID_TILE;
return (v->type == VEH_AIRCRAFT) ? Station::Get(this->GetDestination())->xy : Depot::Get(this->GetDestination())->xy;
default:
@@ -3226,7 +3226,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
if (pbs_look_ahead && reverse) return false;
v->SetDestTile(location);
v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo());
v->current_order.SetDestination(destination);
/* If there is no depot in front, reverse automatically (trains only) */
if (v->type == VEH_TRAIN && reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);