From afef22e3e7caeb41d94115bfd000b4cce68e430d Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 3 Jan 2009 17:11:52 +0000 Subject: (svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ --- src/unmovable_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/unmovable_cmd.cpp') 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)); } -- cgit v1.2.3-54-g00ecf