summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes E. Krause <j.k@eclipso.de>2019-03-12 18:08:13 +0100
committerPeterN <peter@fuzzle.org>2019-03-13 07:47:32 +0000
commite6798ffdca7d374ad23e35f56017a6777cf527ce (patch)
treee5da3a93ed35d4f4597a7a9cf480eb567bd68a21
parent21ec3e55314505153c363ed52857306d595f55d3 (diff)
downloadopenttd-e6798ffdca7d374ad23e35f56017a6777cf527ce.tar.xz
Cleanup: Remove questionable syntax in town rating display
-rw-r--r--src/town_gui.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 17449854d..bc322b08f 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -154,15 +154,14 @@ public:
SetDParam(1, c->index);
int r = this->town->ratings[c->index];
- StringID str;
- (str = STR_CARGO_RATING_APPALLING, r <= RATING_APPALLING) || // Apalling
- (str++, r <= RATING_VERYPOOR) || // Very Poor
- (str++, r <= RATING_POOR) || // Poor
- (str++, r <= RATING_MEDIOCRE) || // Mediocore
- (str++, r <= RATING_GOOD) || // Good
- (str++, r <= RATING_VERYGOOD) || // Very Good
- (str++, r <= RATING_EXCELLENT) || // Excellent
- (str++, true); // Outstanding
+ StringID str = STR_CARGO_RATING_APPALLING;
+ if (r > RATING_APPALLING) str++;
+ if (r > RATING_VERYPOOR) str++;
+ if (r > RATING_POOR) str++;
+ if (r > RATING_MEDIOCRE) str++;
+ if (r > RATING_GOOD) str++;
+ if (r > RATING_VERYGOOD) str++;
+ if (r > RATING_EXCELLENT) str++;
SetDParam(2, str);
if (this->town->exclusivity == c->index) {