summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes E. Krause <j.k@eclipso.de>2019-03-12 14:55:56 +0100
committerPeterN <peter@fuzzle.org>2019-03-13 07:47:32 +0000
commit234f1007f7a6e81f38ddd1de06c6e1727cb9da76 (patch)
tree640783c2d156ed03742cd943194b4c86795228cc /src
parentba3d7122dfcbbee750dad6559b8c354bec873505 (diff)
downloadopenttd-234f1007f7a6e81f38ddd1de06c6e1727cb9da76.tar.xz
Cleanup: Remove questionable syntax in HQ size calculation
Diffstat (limited to 'src')
-rw-r--r--src/object_cmd.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 9f03813df..0b18dd4b1 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -158,12 +158,11 @@ void UpdateCompanyHQ(TileIndex tile, uint score)
{
if (tile == INVALID_TILE) return;
- byte val;
- (val = 0, score < 170) ||
- (val++, score < 350) ||
- (val++, score < 520) ||
- (val++, score < 720) ||
- (val++, true);
+ byte val = 0;
+ if (score >= 170) val++;
+ if (score >= 350) val++;
+ if (score >= 520) val++;
+ if (score >= 720) val++;
while (GetCompanyHQSize(tile) < val) {
IncreaseCompanyHQSize(tile);