* Get the tile height below the aircraft. * This function is needed because aircraft can leave the mapborders. * * @param v The vehicle to get the height for. * @return The height in pixels from 'z_pos' 0. */
| 707 | * @return The height in pixels from 'z_pos' 0. |
| 708 | */ |
| 709 | int GetTileHeightBelowAircraft(const Vehicle *v) |
| 710 | { |
| 711 | int safe_x = Clamp(v->x_pos, 0, Map::MaxX() * TILE_SIZE); |
| 712 | int safe_y = Clamp(v->y_pos, 0, Map::MaxY() * TILE_SIZE); |
| 713 | return TileHeight(TileVirtXY(safe_x, safe_y)) * TILE_HEIGHT; |
| 714 | } |
| 715 | |
| 716 | /** |
| 717 | * Get the 'flight level' bounds, in pixels from 'z_pos' 0 for a particular |
no test coverage detected