summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-03 12:36:40 +0000
committerrubidium <rubidium@openttd.org>2010-08-03 12:36:40 +0000
commit92ac2e485b4a5837be4627860c0f555212052af9 (patch)
tree9a06eb96b5af88a2bf582e53683c31975bb9bcf4 /src/unmovable_cmd.cpp
parent1c86321d3526b70deecb5ea04eb3c878ed37808e (diff)
downloadopenttd-92ac2e485b4a5837be4627860c0f555212052af9.tar.xz
(svn r20341) -Codechange: pass the tile of the HQ instead of the company to UpdateCompanyHQ
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 652b31422..d83e2c843 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -109,13 +109,11 @@ static CommandCost DestroyCompanyHQ(CompanyID cid, DoCommandFlag flags)
return CommandCost(EXPENSES_PROPERTY, CalculateCompanyValue(c) / 100);
}
-void UpdateCompanyHQ(Company *c, uint score)
+void UpdateCompanyHQ(TileIndex tile, uint score)
{
- byte val;
- TileIndex tile = c->location_of_HQ;
-
if (tile == INVALID_TILE) return;
+ byte val;
(val = 0, score < 170) ||
(val++, score < 350) ||
(val++, score < 520) ||
@@ -157,7 +155,7 @@ static CommandCost CmdBuildCompanyHQ(TileIndex tile, DoCommandFlag flags, uint32
BuildUnmovable(UNMOVABLE_HQ, tile, _current_company);
- UpdateCompanyHQ(c, score);
+ UpdateCompanyHQ(tile, score);
SetWindowDirty(WC_COMPANY, c->index);
}