Old revision #p6z7gacvt | New revision #pwme4lx6r | ||
---|---|---|---|
1 | Slope tileh_end_aqueduct = GetTileSlope(tile_end); | 1 | Slope tileh_north_aqueduct = GetTileSlope(tile_start); |
2 | if (tileh_end_aqueduct != ComplementSlope(tileh_start)) { | 2 | if (tileh_north_aqueduct != ComplementSlope(tileh_end)) { |
3 | switch (tileh_start) { | 3 | Slope tileh_north_result; |
4 | switch (tileh_end) { | ||
4 | case SLOPE_NE: | 5 | case SLOPE_NE: |
5 | switch (tileh_ | 5 | switch (tileh_north_aqueduct) { |
6 | case SLOPE_S: | 7 | case SLOPE_S: |
7 | case SLOPE_STEEP_S: | 8 | case SLOPE_STEEP_S: |
8 | tileh_ | 8 | tileh_north_result = SLOPE_W; |
9 | break; | 10 | break; |
10 | case SLOPE_W: | 11 | case SLOPE_W: |
11 | case SLOPE_STEEP_W: | 12 | case SLOPE_STEEP_W: |
12 | tileh_ | 12 | tileh_north_result = SLOPE_S; |
13 | break; | 14 | break; |
14 | default: NOT_REACHED(); | 15 | default: NOT_REACHED(); |
15 | } | 16 | } |
17 | break; | ||
18 | |||
16 | case SLOPE_NW: | 19 | case SLOPE_NW: |
17 | switch (tileh_ | 17 | switch (tileh_north_aqueduct) { |
18 | case SLOPE_E: | 21 | case SLOPE_E: |
19 | case SLOPE_STEEP_E: | 22 | case SLOPE_STEEP_E: |
20 | tileh_ | 20 | tileh_north_result = SLOPE_S; |
21 | break; | 24 | break; |
22 | case SLOPE_S: | 25 | case SLOPE_S: |
23 | case SLOPE_STEEP_S: | 26 | case SLOPE_STEEP_S: |
24 | tileh_end_aqueduct = SLOPE_E; | 27 | tileh_north_result = SLOPE_E; |
28 | break; | ||
29 | default: NOT_REACHED(); | ||
30 | } | ||
31 | break; | ||
32 | |||
33 | case SLOPE_SW: | ||
34 | switch (tileh_north_aqueduct) { | ||
35 | case SLOPE_N: | ||
36 | case SLOPE_STEEP_N: | ||
37 | tileh_north_result = SLOPE_E; | ||
38 | break; | ||
39 | case SLOPE_E: | ||
40 | case SLOPE_STEEP_E: | ||
41 | tileh_north_result = SLOPE_N; | ||
25 | break; | 42 | break; |
26 | default: NOT_REACHED(); | 43 | default: NOT_REACHED(); |
27 | } | 44 | } |
28 | case SLOPE_SW: | 45 | break; |
29 | switch (tileh_end_aqueduct) { | 46 | |
47 | case SLOPE_SE: | ||
48 | switch (tileh_north_aqueduct) { | ||
49 | case SLOPE_W: | ||
50 | case SLOPE_STEEP_W: | ||
51 | tileh_north_result = SLOPE_N; | ||
52 | break; | ||
30 | case SLOPE_N: | 53 | case SLOPE_N: |
31 | case SLOPE_STEEP_N: | 54 | case SLOPE_STEEP_N: |
32 | tileh_end_aqueduct = SLOPE_E; | 32 | tileh_north_result = SLOPE_W; |
33 | break; | ||
34 | case SLOPE_E: | ||
35 | case SLOPE_STEEP_E: | ||
36 | tileh_end_aqueduct = SLOPE_N; | ||
37 | break; | 56 | break; |
38 | default: NOT_REACHED(); | 57 | default: NOT_REACHED(); |
39 | } | 58 | } |
40 | case SLOPE_SE: | 40 | break; |
41 | switch (tileh_end_aqueduct) { | 41 | |
42 | case SLOPE_W: | ||
43 | case SLOPE_STEEP_W: | ||
44 | tileh_end_aqueduct = SLOPE_N; | ||
45 | break; | ||
46 | case SLOPE_N: | ||
47 | case SLOPE_STEEP_N: | ||
48 | tileh_end_aqueduct = SLOPE_W; | ||
49 | break; | ||
50 | default: NOT_REACHED(); | ||
51 | } | ||
52 | default: NOT_REACHED(); | 61 | default: NOT_REACHED(); |
53 | } | 53 | } |
54 | /* Mark the tile as already cleared for the terraform command. | ||
55 | * Do this for all tiles (like trees), not only objects. */ | ||
56 | ClearedObjectArea *coa = FindClearedObject(tile_end); | ||
57 | if (coa == NULL) { | ||
58 | coa = _cleared_object_areas.Append(); | ||
59 | coa->first_tile = tile_end; | ||
60 | coa->area = TileArea(tile_end, 1, 1); | ||
61 | } | ||
62 | |||
63 | /* Hide the tile from the terraforming command */ | ||
64 | TileIndex old_first_tile = coa->first_tile; | ||
65 | coa->first_tile = INVALID_TILE; | ||
66 | ret = DoCommand(tile_end, tileh_end_aqueduct, 1, flags, CMD_TERRAFORM_LAND); | ||
67 | coa->first_tile = old_first_tile; | ||
68 | if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); | ||
69 | cost.AddCost(ret); | ||
70 | } |