diff options
author | tron <tron@openttd.org> | 2006-02-13 21:15:00 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-13 21:15:00 +0000 |
commit | 5352e9fbcbd3b4dca63746f5cf74b1541b8ebb6c (patch) | |
tree | 19340b96ef341c9784a27b719a1a90c2c691ca56 /unmovable_cmd.c | |
parent | 8744075a6cb64578f7e255220d76b77b26eb1a45 (diff) | |
download | openttd-5352e9fbcbd3b4dca63746f5cf74b1541b8ebb6c.tar.xz |
(svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r-- | unmovable_cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c index 4c9a33c5e..07389b414 100644 --- a/unmovable_cmd.c +++ b/unmovable_cmd.c @@ -51,7 +51,7 @@ static int32 DestroyCompanyHQ(TileIndex tile, uint32 flags) DoClearSquare(p->location_of_house + TileDiffXY(1, 0)); DoClearSquare(p->location_of_house + TileDiffXY(1, 1)); p->location_of_house = 0; // reset HQ position - InvalidateWindow(WC_COMPANY, (int)p->index); + InvalidateWindow(WC_COMPANY, p->index); } // cost of relocating company is 1% of company value @@ -91,7 +91,7 @@ int32 CmdBuildCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2) ModifyTile(tile + TileDiffXY(1, 0), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x82); ModifyTile(tile + TileDiffXY(1, 1), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x83); UpdatePlayerHouse(p, score); - InvalidateWindow(WC_COMPANY, (int)p->index); + InvalidateWindow(WC_COMPANY, p->index); } return cost; @@ -346,8 +346,8 @@ void GenerateUnmovables(void) if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == 0 && h >= 32) { if (!checkRadioTowerNearby(tile)) continue; SetTileType(tile, MP_UNMOVABLE); - _m[tile].m5 = 0; SetTileOwner(tile, OWNER_NONE); + _m[tile].m5 = 0; if (--j == 0) break; } } while (--i); @@ -375,8 +375,8 @@ restart: assert(tile == TILE_MASK(tile)); SetTileType(tile, MP_UNMOVABLE); - _m[tile].m5 = 1; SetTileOwner(tile, OWNER_NONE); + _m[tile].m5 = 1; } while (--i); } |