mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Fix #15310: Incorrect map tile indices used for aircraft outside the map
When crashing aircraft or finding hangars
This commit is contained in:
committed by
rubidium42
parent
0670c096f7
commit
f1390b9cf8
@@ -118,7 +118,7 @@ static StationID FindNearestHangar(const Aircraft *v)
|
||||
{
|
||||
uint best = 0;
|
||||
StationID index = StationID::Invalid();
|
||||
TileIndex vtile = TileVirtXY(v->x_pos, v->y_pos);
|
||||
TileIndex vtile = TileVirtXYClampedToMap(v->x_pos, v->y_pos);
|
||||
const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
|
||||
uint max_range = v->acache.cached_max_range_sqr;
|
||||
|
||||
@@ -1352,7 +1352,7 @@ static void CrashAirplane(Aircraft *v)
|
||||
v->cargo.Truncate();
|
||||
v->Next()->cargo.Truncate();
|
||||
const Station *st = GetTargetAirportIfValid(v);
|
||||
TileIndex vt = TileVirtXY(v->x_pos, v->y_pos);
|
||||
TileIndex vt = TileVirtXYClampedToMap(v->x_pos, v->y_pos);
|
||||
|
||||
EncodedString headline;
|
||||
if (st == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user