Use separate tile hash for each vehicle type
This commit is contained in:
@@ -329,7 +329,7 @@ Vehicle *FindVehiclesInRoadStop(Vehicle *v, void *data)
|
||||
{
|
||||
RoadStopEntryRebuilderHelper *rserh = (RoadStopEntryRebuilderHelper*)data;
|
||||
/* Not a RV or not in the right direction or crashed :( */
|
||||
if (v->type != VEH_ROAD || DirToDiagDir(v->direction) != rserh->dir || !v->IsPrimaryVehicle() || (v->vehstatus & VS_CRASHED) != 0) return nullptr;
|
||||
if (DirToDiagDir(v->direction) != rserh->dir || !v->IsPrimaryVehicle() || (v->vehstatus & VS_CRASHED) != 0) return nullptr;
|
||||
|
||||
RoadVehicle *rv = RoadVehicle::From(v);
|
||||
/* Don't add ones not in a road stop */
|
||||
@@ -363,7 +363,7 @@ void RoadStop::Entry::Rebuild(const RoadStop *rs, int side)
|
||||
TileIndexDiff offset = abs(TileOffsByDiagDir(dir));
|
||||
for (TileIndex tile = rs->xy; IsDriveThroughRoadStopContinuation(rs->xy, tile); tile += offset) {
|
||||
this->length += TILE_SIZE;
|
||||
FindVehicleOnPos(tile, &rserh, FindVehiclesInRoadStop);
|
||||
FindVehicleOnPos(tile, VEH_ROAD, &rserh, FindVehiclesInRoadStop);
|
||||
}
|
||||
|
||||
this->occupied = 0;
|
||||
|
Reference in New Issue
Block a user