1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 22:54:29 +01:00

Feature: Allow to build buoys at (0x0).

This commit is contained in:
Rito12
2025-12-25 19:51:31 +01:00
committed by rubidium42
parent 9e7cb99dc2
commit dc663d7b0a
10 changed files with 26 additions and 20 deletions

View File

@@ -1951,7 +1951,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
{
if (conditional_depth > v->GetNumOrders()) {
v->current_order.Free();
v->SetDestTile(TileIndex{});
v->SetDestTile(INVALID_TILE);
return false;
}
@@ -1971,7 +1971,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
if (v->current_order.GetDepotActionType().Test(OrderDepotActionFlag::NearestDepot)) {
/* If the vehicle can't find its destination, delay its next search.
* In case many vehicles are in this state, use the vehicle index to spread out pathfinder calls. */
if (v->dest_tile == 0 && TimerGameEconomy::date_fract != (v->index % Ticks::DAY_TICKS)) break;
if (v->dest_tile == INVALID_TILE && TimerGameEconomy::date_fract != (v->index % Ticks::DAY_TICKS)) break;
/* We need to search for the nearest depot (hangar). */
ClosestDepot closest_depot = v->FindClosestDepot();
@@ -2045,7 +2045,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
}
default:
v->SetDestTile(TileIndex{});
v->SetDestTile(INVALID_TILE);
return false;
}
@@ -2061,7 +2061,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
if (order == nullptr) {
v->current_order.Free();
v->SetDestTile(TileIndex{});
v->SetDestTile(INVALID_TILE);
return false;
}
@@ -2136,12 +2136,12 @@ bool ProcessOrders(Vehicle *v)
}
v->current_order.Free();
v->SetDestTile(TileIndex{});
v->SetDestTile(INVALID_TILE);
return false;
}
/* If it is unchanged, keep it. */
if (order->Equals(v->current_order) && (v->type == VEH_AIRCRAFT || v->dest_tile != 0) &&
if (order->Equals(v->current_order) && (v->type == VEH_AIRCRAFT || v->dest_tile != INVALID_TILE) &&
(v->type != VEH_SHIP || !order->IsType(OT_GOTO_STATION) || Station::Get(order->GetDestination().ToStationID())->ship_station.tile != INVALID_TILE)) {
return false;
}