diff --git a/changelog.txt b/changelog.txt index 1bf3fd0dc6..17391a3067 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,7 +23,6 @@ X 13623 make things look nicer - Fix: First determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good (r13489) - Fix: Track was not removed on company bankrupcy when there was a ship on lower halftile (r13488) - Fix: Let ships also navigate on half-tile sloped watery rail tiles (r13485) -- Fix: Road vehicles stoppping at drive through stations of other companies [FS#2050] (r13480) - Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409) - Fix: Do not crash when resolving vehicle sprite groups with zero sprites (r13397) - Fix: In the purchase list, CB36 for capacity was not called for the first part of rail and road vehicles (r13385) diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index cc4171af44..6071147c25 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1814,13 +1814,12 @@ again: v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) { RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile)); - Station* st = GetStationByTile(v->tile); + Station *st = GetStationByTile(v->tile); /* Vehicle is at the stop position (at a bay) in a road stop. * Note, if vehicle is loading/unloading it has already been handled, * so if we get here the vehicle has just arrived or is just ready to leave. */ - if (v->current_order.type != OT_LEAVESTATION && - v->current_order.type != OT_GOTO_DEPOT) { + if (v->current_order.type != OT_LEAVESTATION) { /* Vehicle has arrived at a bay in a road stop */ if (IsDriveThroughStopTile(v->tile)) { @@ -1828,7 +1827,7 @@ again: RoadStop::Type type = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK; /* Check if next inline bay is free */ - if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type)) { + if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type) && GetStationIndex(v->tile) == GetStationIndex(next_tile)) { RoadStop *rs_n = GetRoadStopByTile(next_tile, type); if (rs_n->IsFreeBay(HasBit(v->u.road.state, RVS_USING_SECOND_BAY))) { @@ -1850,14 +1849,13 @@ again: v->last_station_visited = GetStationIndex(v->tile); - RoadVehArrivesAt(v, st); - v->BeginLoading(); - - return false; - } - - /* Vehicle is ready to leave a bay in a road stop */ - if (v->current_order.type != OT_GOTO_DEPOT) { + if (IsDriveThroughStopTile(v->tile) || (v->current_order.type == OT_GOTO_STATION && v->current_order.dest == st->index)) { + RoadVehArrivesAt(v, st); + v->BeginLoading(); + return false; + } + } else { + /* Vehicle is ready to leave a bay in a road stop */ if (rs->IsEntranceBusy()) { /* Road stop entrance is busy, so wait as there is nowhere else to go */ v->cur_speed = 0; diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index d851f31ba6..1c95d716f8 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -23,7 +23,7 @@ void DrawRoadVehDetails(const Vehicle *v, int x, int y) { - uint y_offset = RoadVehHasArticPart(v) ? 15 :0; + uint y_offset = RoadVehHasArticPart(v) ? 15 : 0; StringID str; SetDParam(0, v->engine_type); @@ -62,6 +62,8 @@ void DrawRoadVehDetails(const Vehicle *v, int x, int y) DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x); for (const Vehicle *u = v; u != NULL; u = u->Next()) { + if (u->cargo_cap == 0) continue; + str = STR_8812_EMPTY; if (!u->cargo.Empty()) { SetDParam(0, u->cargo_type); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 57fabec4e9..98ac0b877c 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -275,7 +275,7 @@ static RefitList *BuildRefitList(const Vehicle *v) } } } - } while (v->type == VEH_TRAIN && (u = u->Next()) != NULL && num_lines < max_lines); + } while ((v->type == VEH_TRAIN || v->type == VEH_ROAD) && (u = u->Next()) != NULL && num_lines < max_lines); list->num_lines = num_lines; list->items = refit; @@ -1378,7 +1378,7 @@ void CreateVehicleDetailsWindow(Window *w) /* Add space for the cargo amount for each part. */ for (const Vehicle *u = v; u != NULL; u = u->Next()) { - height_extension += 11; + if (u->cargo_cap != 0) height_extension += 11; } ResizeWindow(w, 0, height_extension);