Use separate tile hash for each vehicle type

This commit is contained in:
Jonathan G Rennison
2020-02-28 22:21:10 +00:00
parent 4020719227
commit 4108672cf6
14 changed files with 227 additions and 221 deletions

View File

@@ -268,7 +268,7 @@ public:
{
uint *count = (uint *)data;
/* Ignore other vehicles (aircraft) and ships inside depot. */
if (v->type == VEH_SHIP && (v->vehstatus & VS_HIDDEN) == 0) (*count)++;
if ((v->vehstatus & VS_HIDDEN) == 0) (*count)++;
return nullptr;
}
@@ -288,7 +288,7 @@ public:
if (IsDockingTile(n.GetTile())) {
/* Check docking tile for occupancy */
uint count = 1;
HasVehicleOnPos(n.GetTile(), &count, &CountShipProc);
HasVehicleOnPos(n.GetTile(), VEH_SHIP, &count, &CountShipProc);
c += count * 3 * YAPF_TILE_LENGTH;
}