Old revision #pjorloxax | New revision #plgp1zulc | ||
---|---|---|---|
1 | static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags) | 1 | static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags) |
2 | { | 2 | { |
3 | CommandCost cost(EXPENSES_CONSTRUCTION); | 3 | CommandCost cost(EXPENSES_CONSTRUCTION); |
4 | if (GetTileOwner(tile) != OWNER_NONE) { | 4 | |
5 | if (GetTileOwner(tile) != OWNER_NONE) { | ||
5 | CommandCost ret = CheckTileOwnership(tile); | 6 | CommandCost ret = CheckTileOwnership(tile); |
6 | if (ret.Failed()) return ret; | 7 | if (ret.Failed()) return ret; |
7 | |||
8 | } | 8 | } |
9 | 9 | ||
10 | TileIndexDiff delta = TileOffsByDiagDir(GetLockDirection(tile)); | 10 | TileIndexDiff delta = TileOffsByDiagDir(GetLockDirection(tile)); | … | … |
38 | MarkCanalsAndRiversAroundDirty(tile + delta); | 38 | MarkCanalsAndRiversAroundDirty(tile + delta); |
39 | } | 39 | } |
40 | 40 | ||
41 | return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]); | 41 | if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_CANAL]); |
42 | cost.AddCost(_price[PR_CLEAR_LOCK]); | ||
43 | return cost; | ||
44 | |||
42 | } | 45 | } |