equal
deleted
inserted
replaced
17 #include "vehicle_func.h" |
17 #include "vehicle_func.h" |
18 #include "sound_func.h" |
18 #include "sound_func.h" |
19 #include "viewport_func.h" |
19 #include "viewport_func.h" |
20 #include "gfx_func.h" |
20 #include "gfx_func.h" |
21 #include "player_func.h" |
21 #include "player_func.h" |
|
22 #include "slope_func.h" |
22 |
23 |
23 #include "table/sprites.h" |
24 #include "table/sprites.h" |
24 #include "table/strings.h" |
25 #include "table/strings.h" |
25 |
26 |
26 static void ShowBuildDockStationPicker(); |
27 static void ShowBuildDockStationPicker(); |
187 |
188 |
188 case WE_PLACE_PRESIZE: { |
189 case WE_PLACE_PRESIZE: { |
189 TileIndex tile_from; |
190 TileIndex tile_from; |
190 TileIndex tile_to; |
191 TileIndex tile_to; |
191 |
192 |
192 tile_from = tile_to = e->we.place.tile; |
193 tile_from = e->we.place.tile; |
193 switch (GetTileSlope(tile_from, NULL)) { |
194 |
194 case SLOPE_SW: tile_to += TileDiffXY(-1, 0); break; |
195 DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile_from, NULL)); |
195 case SLOPE_SE: tile_to += TileDiffXY( 0, -1); break; |
196 tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile_from, ReverseDiagDir(dir)) : tile_from); |
196 case SLOPE_NW: tile_to += TileDiffXY( 0, 1); break; |
197 |
197 case SLOPE_NE: tile_to += TileDiffXY( 1, 0); break; |
|
198 default: break; |
|
199 } |
|
200 VpSetPresizeRange(tile_from, tile_to); |
198 VpSetPresizeRange(tile_from, tile_to); |
201 } break; |
199 } break; |
202 |
200 |
203 case WE_DESTROY: |
201 case WE_DESTROY: |
204 if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0); |
202 if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0); |