636 uint sy = TileY(start); |
636 uint sy = TileY(start); |
637 uint ex = TileX(end); |
637 uint ex = TileX(end); |
638 uint ey = TileY(end); |
638 uint ey = TileY(end); |
639 uint w,h; |
639 uint w,h; |
640 |
640 |
641 if (sx > ex) uintswap(sx,ex); |
641 if (sx > ex) Swap(sx, ex); |
642 if (sy > ey) uintswap(sy,ey); |
642 if (sy > ey) Swap(sy, ey); |
643 w = ex - sx + 1; |
643 w = ex - sx + 1; |
644 h = ey - sy + 1; |
644 h = ey - sy + 1; |
645 if (!_railstation.orientation) uintswap(w,h); |
645 if (!_railstation.orientation) Swap(w, h); |
646 |
646 |
647 DoCommandP(TileXY(sx, sy), |
647 DoCommandP(TileXY(sx, sy), |
648 _railstation.orientation | (w << 8) | (h << 16), |
648 _railstation.orientation | (w << 8) | (h << 16), |
649 _cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation, |
649 _cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation, |
650 CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); |
650 CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); |
702 if (_railstation.dragdrop) { |
702 if (_railstation.dragdrop) { |
703 SetTileSelectSize(1, 1); |
703 SetTileSelectSize(1, 1); |
704 } else { |
704 } else { |
705 int x = _railstation.numtracks; |
705 int x = _railstation.numtracks; |
706 int y = _railstation.platlength; |
706 int y = _railstation.platlength; |
707 if (_railstation.orientation == 0) intswap(x,y); |
707 if (_railstation.orientation == 0) Swap(x, y); |
708 if (!_remove_button_clicked) |
708 if (!_remove_button_clicked) |
709 SetTileSelectSize(x, y); |
709 SetTileSelectSize(x, y); |
710 } |
710 } |
711 |
711 |
712 rad = (_patches.modified_catchment) ? CA_TRAIN : 4; |
712 rad = (_patches.modified_catchment) ? CA_TRAIN : 4; |