summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index fd5f5d487..648939975 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -2021,11 +2021,7 @@ struct CargoesField {
assert(this->type == CFT_CARGO);
int n = this->u.cargo.num_cargoes;
- if (n % 2 == 0) {
- return xpos + cargo_field_width / 2 - (CargoesField::cargo_line.width + CargoesField::cargo_space.width / 2) * (n / 2);
- } else {
- return xpos + cargo_field_width / 2 - CargoesField::cargo_line.width / 2 - (CargoesField::cargo_line.width + CargoesField::cargo_space.width) * (n / 2);
- }
+ return xpos + cargo_field_width / 2 - (CargoesField::cargo_line.width * n + CargoesField::cargo_space.width * (n - 1)) / 2;
}
/**