mirror of https://github.com/OpenTTD/OpenTTD
(svn r4662) - Backport from trunk (r4192):
Fix: In the depot, moving wagons from the end of a very long train to a short train where the short train was scrolled off the window would cause a game crash.release/0.4
parent
3a3a1da4e7
commit
8bfb955d4b
|
@ -518,13 +518,10 @@ found_it:
|
||||||
return (x >= -10) ? -2 : -1;
|
return (x >= -10) ? -2 : -1;
|
||||||
|
|
||||||
// skip vehicles that are scrolled off the left side
|
// skip vehicles that are scrolled off the left side
|
||||||
while (skip--) v = v->next;
|
while (v != NULL && skip--) v = v->next;
|
||||||
|
|
||||||
/* find the vehicle in this row that was clicked */
|
/* find the vehicle in this row that was clicked */
|
||||||
while ((x -= WagonLengthToPixels(v->u.rail.cached_veh_length)) >= 0) {
|
while (v != NULL && (x -= WagonLengthToPixels(v->u.rail.cached_veh_length)) >= 0) v = v->next;
|
||||||
v = v->next;
|
|
||||||
if (v == NULL) break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if an articulated part was selected, find its parent
|
// if an articulated part was selected, find its parent
|
||||||
while (v != NULL && IsArticulatedPart(v)) v = GetPrevVehicleInChain(v);
|
while (v != NULL && IsArticulatedPart(v)) v = GetPrevVehicleInChain(v);
|
||||||
|
|
Loading…
Reference in New Issue