ai/default/default.c
changeset 5247 1f982de55b88
parent 5031 93e873e3ab03
child 5385 3868f2e6db9b
equal deleted inserted replaced
5246:fb214a312549 5247:1f982de55b88
  3584 
  3584 
  3585 	// Go to this state when we're done.
  3585 	// Go to this state when we're done.
  3586 	p->ai.state = AIS_1;
  3586 	p->ai.state = AIS_1;
  3587 
  3587 
  3588 	// Get a list of all stations that are in use by a vehicle
  3588 	// Get a list of all stations that are in use by a vehicle
  3589 	in_use = malloc(GetStationArraySize());
  3589 	in_use = malloc(GetMaxStationIndex() + 1);
  3590 	memset(in_use, 0, GetStationArraySize());
  3590 	memset(in_use, 0, GetMaxStationIndex() + 1);
  3591 	FOR_ALL_ORDERS(ord) {
  3591 	FOR_ALL_ORDERS(ord) {
  3592 		if (ord->type == OT_GOTO_STATION) in_use[ord->dest] = 1;
  3592 		if (ord->type == OT_GOTO_STATION) in_use[ord->dest] = 1;
  3593 	}
  3593 	}
  3594 
  3594 
  3595 	// Go through all stations and delete those that aren't in use
  3595 	// Go through all stations and delete those that aren't in use