diff -r fb214a312549 -r 1f982de55b88 ai/default/default.c --- a/ai/default/default.c Tue Dec 05 12:17:31 2006 +0000 +++ b/ai/default/default.c Tue Dec 05 13:58:20 2006 +0000 @@ -3586,8 +3586,8 @@ p->ai.state = AIS_1; // Get a list of all stations that are in use by a vehicle - in_use = malloc(GetStationArraySize()); - memset(in_use, 0, GetStationArraySize()); + in_use = malloc(GetMaxStationIndex() + 1); + memset(in_use, 0, GetMaxStationIndex() + 1); FOR_ALL_ORDERS(ord) { if (ord->type == OT_GOTO_STATION) in_use[ord->dest] = 1; }