summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
committersmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
commitafef22e3e7caeb41d94115bfd000b4cce68e430d (patch)
tree1b6c7083c14efc8630c4839005e7b1c3c4610160 /src/unmovable_cmd.cpp
parent6512d717e168fd1a5253a7ebe31e772824131de7 (diff)
downloadopenttd-afef22e3e7caeb41d94115bfd000b4cce68e430d.tar.xz
(svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index e2efec469..71e514c2f 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -51,7 +51,7 @@ static CommandCost DestroyCompanyHQ(CompanyID cid, uint32 flags)
DoClearSquare(t + TileDiffXY(0, 1));
DoClearSquare(t + TileDiffXY(1, 0));
DoClearSquare(t + TileDiffXY(1, 1));
- c->location_of_HQ = 0; // reset HQ position
+ c->location_of_HQ = INVALID_TILE; // reset HQ position
InvalidateWindow(WC_COMPANY, cid);
}
@@ -64,7 +64,7 @@ void UpdateCompanyHQ(Company *c, uint score)
byte val;
TileIndex tile = c->location_of_HQ;
- if (tile == 0) return;
+ if (tile == INVALID_TILE) return;
(val = 0, score < 170) ||
(val++, score < 350) ||
@@ -96,7 +96,7 @@ CommandCost CmdBuildCompanyHQ(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
cost = CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL);
if (CmdFailed(cost)) return cost;
- if (c->location_of_HQ != 0) { // Moving HQ
+ if (c->location_of_HQ != INVALID_TILE) { // Moving HQ
cost.AddCost(DestroyCompanyHQ(_current_company, flags));
}