(svn r18667) -Fix [FS#3454]: [NoAI] crash when trying to get the order destination of a 'nearest depot' order
This commit is contained in:
@@ -175,6 +175,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
|||||||
|
|
||||||
switch (order->GetType()) {
|
switch (order->GetType()) {
|
||||||
case OT_GOTO_DEPOT: {
|
case OT_GOTO_DEPOT: {
|
||||||
|
/* We don't know where the nearest depot is... (yet) */
|
||||||
|
if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) return INVALID_TILE;
|
||||||
|
|
||||||
if (v->type != VEH_AIRCRAFT) return ::Depot::Get(order->GetDestination())->xy;
|
if (v->type != VEH_AIRCRAFT) return ::Depot::Get(order->GetDestination())->xy;
|
||||||
/* Aircraft's hangars are referenced by StationID, not DepotID */
|
/* Aircraft's hangars are referenced by StationID, not DepotID */
|
||||||
const Station *st = ::Station::Get(order->GetDestination());
|
const Station *st = ::Station::Get(order->GetDestination());
|
||||||
|
Reference in New Issue
Block a user