summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/roadveh_gui.cpp4
-rw-r--r--src/vehicle_gui.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index 7796b7889..23f5989e5 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 398db3eb5..404e82460 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1309,7 +1309,7 @@ struct VehicleDetailsWindow : Window {
/* 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(this, 0, height_extension);