625 uint sy = TileY(start); |
625 uint sy = TileY(start); |
626 uint ex = TileX(end); |
626 uint ex = TileX(end); |
627 uint ey = TileY(end); |
627 uint ey = TileY(end); |
628 uint w,h; |
628 uint w,h; |
629 |
629 |
630 if (sx > ex) intswap(sx,ex); |
630 if (sx > ex) uintswap(sx,ex); |
631 if (sy > ey) intswap(sy,ey); |
631 if (sy > ey) uintswap(sy,ey); |
632 w = ex - sx + 1; |
632 w = ex - sx + 1; |
633 h = ey - sy + 1; |
633 h = ey - sy + 1; |
634 if (!_railstation.orientation) intswap(w,h); |
634 if (!_railstation.orientation) uintswap(w,h); |
635 |
635 |
636 // TODO: Custom station selector GUI. Now we just try using first custom station |
636 // TODO: Custom station selector GUI. Now we just try using first custom station |
637 // (and fall back to normal stations if it isn't available). |
637 // (and fall back to normal stations if it isn't available). |
638 DoCommandP(TILE_XY(sx,sy), _railstation.orientation | (w<<8) | (h<<16),_cur_railtype|1<<4, CcStation, |
638 DoCommandP(TILE_XY(sx,sy), _railstation.orientation | (w<<8) | (h<<16),_cur_railtype|1<<4, CcStation, |
639 CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); |
639 CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); |