diff options
author | rubidium <rubidium@openttd.org> | 2013-11-28 19:37:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-28 19:37:24 +0000 |
commit | aa8f9e28a2d43f025d031af571efbd897630a7a5 (patch) | |
tree | 1286d7638143c2935db1495abd50f27cc9d9615c | |
parent | f6362ae29894a9c46c5024639e999c203547e83c (diff) | |
download | openttd-aa8f9e28a2d43f025d031af571efbd897630a7a5.tar.xz |
(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
-rw-r--r-- | src/aircraft_cmd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index e5dea8b75..ee89fbf0d 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -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; |