summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-03-31 09:09:26 +0000
committercelestar <celestar@openttd.org>2006-03-31 09:09:26 +0000
commitb34daea3f2f9a1d5d15fbd723a9ff3c13adcfdf2 (patch)
tree538459d686ebc5fe02d81cb3357858894f1b241a /unmovable_cmd.c
parentc203fdaafae1208dd14b6e5abdab37fc984821a7 (diff)
downloadopenttd-b34daea3f2f9a1d5d15fbd723a9ff3c13adcfdf2.tar.xz
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 497a61167..da6b8cf2c 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -67,20 +67,13 @@ void UpdateCompanyHQ(Player *p, uint score)
if (tile == 0)
return;
- (val = 128, score < 170) ||
- (val+= 4, score < 350) ||
- (val+= 4, score < 520) ||
- (val+= 4, score < 720) ||
- (val+= 4, true);
-
-/* house is already big enough */
- if (val <= _m[tile].m5)
- return;
+ (val = 0, score < 170) ||
+ (val++, score < 350) ||
+ (val++, score < 520) ||
+ (val++, score < 720) ||
+ (val++, true);
- _m[tile + TileDiffXY(0, 0)].m5 = val;
- _m[tile + TileDiffXY(0, 1)].m5 = ++val;
- _m[tile + TileDiffXY(1, 0)].m5 = ++val;
- _m[tile + TileDiffXY(1, 1)].m5 = ++val;
+ EnlargeCompanyHQ(tile, val);
MarkTileDirtyByTile(tile + TileDiffXY(0, 0));
MarkTileDirtyByTile(tile + TileDiffXY(0, 1));