summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Trahan <tyler@tylertrahan.com>2021-02-14 17:42:29 -0500
committerGitHub <noreply@github.com>2021-02-14 23:42:29 +0100
commitce06b03faca3aca77efb28c799f2c575cb96211a (patch)
tree7b29684ffa954e73c9636c7b8c891a1ff629b040
parent91cc414588548e7752fb707b4547f63db597aca1 (diff)
downloadopenttd-ce06b03faca3aca77efb28c799f2c575cb96211a.tar.xz
Fix: Stopped ships shouldn't block depots (#8578)
-rw-r--r--src/ship_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 825321e10..ca159531a 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -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);