mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
Fix: Stopped ships shouldn't block depots (#8578)
This commit is contained in:
parent
91cc414588
commit
ce06b03fac
@ -328,11 +328,11 @@ void Ship::UpdateDeltaXY()
|
||||
}
|
||||
|
||||
/**
|
||||
* Test-procedure for HasVehicleOnPos to check for a ship.
|
||||
* Test-procedure for HasVehicleOnPos to check for any ships which are visible and not stopped by the player.
|
||||
*/
|
||||
static Vehicle *EnsureNoVisibleShipProc(Vehicle *v, void *data)
|
||||
static Vehicle *EnsureNoMovingShipProc(Vehicle *v, void *data)
|
||||
{
|
||||
return v->type == VEH_SHIP && (v->vehstatus & VS_HIDDEN) == 0 ? v : nullptr;
|
||||
return v->type == VEH_SHIP && (v->vehstatus & (VS_HIDDEN | VS_STOPPED)) == 0 ? v : nullptr;
|
||||
}
|
||||
|
||||
static bool CheckShipLeaveDepot(Ship *v)
|
||||
@ -351,7 +351,7 @@ static bool CheckShipLeaveDepot(Ship *v)
|
||||
|
||||
/* Don't leave depot if another vehicle is already entering/leaving */
|
||||
/* This helps avoid CPU load if many ships are set to start at the same time */
|
||||
if (HasVehicleOnPos(v->tile, nullptr, &EnsureNoVisibleShipProc)) return true;
|
||||
if (HasVehicleOnPos(v->tile, nullptr, &EnsureNoMovingShipProc)) return true;
|
||||
|
||||
TileIndex tile = v->tile;
|
||||
Axis axis = GetShipDepotAxis(tile);
|
||||
|
Loading…
Reference in New Issue
Block a user