Fix various narrowing cast warnings

This commit is contained in:
Jonathan G Rennison
2024-01-22 02:19:33 +00:00
parent 5f7034f23c
commit f1073d20e9
3 changed files with 4 additions and 4 deletions

View File

@@ -1281,8 +1281,8 @@ CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta)
/* determine new size of train station region.. */
int x = std::min(TileX(cur_ta.tile), TileX(new_ta.tile));
int y = std::min(TileY(cur_ta.tile), TileY(new_ta.tile));
new_ta.w = std::max(TileX(cur_ta.tile) + cur_ta.w, TileX(new_ta.tile) + new_ta.w) - x;
new_ta.h = std::max(TileY(cur_ta.tile) + cur_ta.h, TileY(new_ta.tile) + new_ta.h) - y;
new_ta.w = (uint16_t)std::max(TileX(cur_ta.tile) + cur_ta.w, TileX(new_ta.tile) + new_ta.w) - x;
new_ta.h = (uint16_t)std::max(TileY(cur_ta.tile) + cur_ta.h, TileY(new_ta.tile) + new_ta.h) - y;
new_ta.tile = TileXY(x, y);
/* make sure the final size is not too big. */