mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r1358) Assert bounds of depot list when searching for a depot
This commit is contained in:
parent
036b043f9f
commit
815bac212a
@ -512,7 +512,9 @@ static void DrawRoadDepotWindow(Window *w)
|
||||
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
||||
|
||||
/* locate the depot struct */
|
||||
for(d=_depots; d->xy != (TileIndex)tile; d++) {}
|
||||
for (d = _depots; d->xy != (TileIndex)tile; d++) {
|
||||
assert(d < endof(_depots);
|
||||
}
|
||||
|
||||
SetDParam(0, d->town_index);
|
||||
DrawWindowWidgets(w);
|
||||
|
@ -646,7 +646,9 @@ static void DrawShipDepotWindow(Window *w)
|
||||
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
||||
|
||||
/* locate the depot struct */
|
||||
for(d=_depots; d->xy != (TileIndex)tile; d++) {}
|
||||
for (d = _depots; d->xy != (TileIndex)tile; d++) {
|
||||
assert(d < endof(_depots);
|
||||
}
|
||||
|
||||
SetDParam(0, d->town_index);
|
||||
DrawWindowWidgets(w);
|
||||
|
@ -333,7 +333,9 @@ static void DrawTrainDepotWindow(Window *w)
|
||||
SetHScrollCount(w, hnum);
|
||||
|
||||
/* locate the depot struct */
|
||||
for(d=_depots; d->xy != (TileIndex)tile; d++) {}
|
||||
for (d = _depots; d->xy != (TileIndex)tile; d++) {
|
||||
assert(d < endof(_depots);
|
||||
}
|
||||
|
||||
SetDParam(0, d->town_index);
|
||||
DrawWindowWidgets(w);
|
||||
|
Loading…
Reference in New Issue
Block a user