Old revision #pg4tog6je | New revision #pqeuk1r9b | ||
---|---|---|---|
1 | Index: src/water_cmd.cpp | 1 | Index: src/water_cmd.cpp |
2 | =================================================================== | 2 | =================================================================== |
3 | --- src/water_cmd.cpp (revision 2719 | 3 | --- src/water_cmd.cpp (revision 27196) |
4 | +++ src/water_cmd.cpp (working copy) | 4 | +++ src/water_cmd.cpp (working copy) |
5 | @@ -419,6 +419,7 @@ | 5 | @@ -419,6 +419,7 @@ |
6 | if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue; | 6 | if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue; |
7 | 7 | ||
8 | bool water = IsWaterTile(tile); | 8 | bool water = IsWaterTile(tile); |
9 | + bool river = | 9 | + bool river = HasTileWaterClass(tile) && GetWaterClass(tile) == WATER_CLASS_RIVER; |
10 | ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR); | 10 | ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR); |
11 | if (ret.Failed()) return ret; | 11 | if (ret.Failed()) return ret; |
12 | 12 | … | … |
17 | + if (river) SB(_me[tile].m6, 0, 0, 1); | 17 | + if (river) SB(_me[tile].m6, 0, 0, 1); |
18 | MakeCanal(tile, _current_company, Random()); | 18 | MakeCanal(tile, _current_company, Random()); |
19 | if (Company::IsValidID(_current_company)) { | 19 | if (Company::IsValidID(_current_company)) { |
20 | Company::Get(_current_company)->infrastructure.water++; | 20 | Company::Get(_current_company)->infrastructure.water++; |
21 | @@ -485,7 +487,7 @@ | ||
22 | CommandCost ret = CheckTileOwnership(tile); | ||
23 | if (ret.Failed()) return ret; | ||
24 | } | ||
25 | - | ||
26 | + bool river = HasBit(_me[tile].m6, 0); | ||
27 | if (flags & DC_EXEC) { | ||
28 | if (IsCanal(tile) && Company::IsValidID(owner)) { | ||
29 | Company::Get(owner)->infrastructure.water--; | ||
30 | @@ -492,9 +494,9 @@ | ||
31 | DirtyCompanyInfrastructureWindows(owner); | ||
32 | } | ||
33 | DoClearSquare(tile); | ||
34 | + if (river) MakeRiver(tile, Random()); | ||
35 | MarkCanalsAndRiversAroundDirty(tile); | ||
36 | } | ||
37 | - | ||
38 | return CommandCost(EXPENSES_CONSTRUCTION, base_cost); | ||
39 | } |