diff options
author | Johannes E. Krause <j.k@eclipso.de> | 2019-03-12 14:55:56 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-13 07:47:32 +0000 |
commit | 234f1007f7a6e81f38ddd1de06c6e1727cb9da76 (patch) | |
tree | 640783c2d156ed03742cd943194b4c86795228cc | |
parent | ba3d7122dfcbbee750dad6559b8c354bec873505 (diff) | |
download | openttd-234f1007f7a6e81f38ddd1de06c6e1727cb9da76.tar.xz |
Cleanup: Remove questionable syntax in HQ size calculation
-rw-r--r-- | src/object_cmd.cpp | 11 |
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); |