mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(svn r18667) -Fix [FS#3454]: [NoAI] crash when trying to get the order destination of a 'nearest depot' order
This commit is contained in:
parent
4801b17837
commit
e6dbe673f0
@ -175,6 +175,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
|
||||
switch (order->GetType()) {
|
||||
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;
|
||||
/* Aircraft's hangars are referenced by StationID, not DepotID */
|
||||
const Station *st = ::Station::Get(order->GetDestination());
|
||||
|
Loading…
Reference in New Issue
Block a user