mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r26134) -Fix [FS#5820]: aircraft crashing near the map's border due to a lack of airports could trigger an assertion in most builds
This commit is contained in:
parent
f6362ae298
commit
aa8f9e28a2
|
@ -1032,7 +1032,7 @@ static bool HandleCrashedAircraft(Aircraft *v)
|
|||
|
||||
/* make aircraft crash down to the ground */
|
||||
if (v->crashed_counter < 500 && st == NULL && ((v->crashed_counter % 3) == 0) ) {
|
||||
int z = GetSlopePixelZ(v->x_pos, v->y_pos);
|
||||
int z = GetSlopePixelZ(Clamp(v->x_pos, 0, MapMaxX() * TILE_SIZE), Clamp(v->y_pos, 0, MapMaxY() * TILE_SIZE));
|
||||
v->z_pos -= 1;
|
||||
if (v->z_pos == z) {
|
||||
v->crashed_counter = 500;
|
||||
|
|
Loading…
Reference in New Issue