463 const RoadTypes rts = (RoadTypes)GB(p1, 0, 3); |
463 const RoadTypes rts = (RoadTypes)GB(p1, 0, 3); |
464 if (!AreValidRoadTypes(rts) || !HasRoadTypesAvail(_current_player, rts)) return CMD_ERROR; |
464 if (!AreValidRoadTypes(rts) || !HasRoadTypesAvail(_current_player, rts)) return CMD_ERROR; |
465 } |
465 } |
466 |
466 |
467 start_tileh = GetTileSlope(start_tile, &start_z); |
467 start_tileh = GetTileSlope(start_tile, &start_z); |
468 |
468 direction = GetInclinedSlopeDirection(start_tileh); |
469 switch (start_tileh) { |
469 if (direction == INVALID_DIAGDIR) return_cmd_error(STR_500B_SITE_UNSUITABLE_FOR_TUNNEL); |
470 case SLOPE_SW: direction = DIAGDIR_SW; break; |
|
471 case SLOPE_SE: direction = DIAGDIR_SE; break; |
|
472 case SLOPE_NW: direction = DIAGDIR_NW; break; |
|
473 case SLOPE_NE: direction = DIAGDIR_NE; break; |
|
474 default: return_cmd_error(STR_500B_SITE_UNSUITABLE_FOR_TUNNEL); |
|
475 } |
|
476 |
470 |
477 if (IsRiverTile(start_tile)) return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER); |
471 if (IsRiverTile(start_tile)) return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER); |
478 |
472 |
479 ret = DoCommand(start_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
473 ret = DoCommand(start_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
480 if (CmdFailed(ret)) return ret; |
474 if (CmdFailed(ret)) return ret; |