misc.c
changeset 1279 4f83fbde72de
parent 1247 01711347f9ac
child 1304 8570010abe7b
equal deleted inserted replaced
1278:1fbb6cf8d3f1 1279:4f83fbde72de
   602 		max size of _date_fract / 885 (added each tick) is number of times before ctr is reset.
   602 		max size of _date_fract / 885 (added each tick) is number of times before ctr is reset.
   603 		Calculation might look complicated, but compiler just replaces it with 35, so that's ok
   603 		Calculation might look complicated, but compiler just replaces it with 35, so that's ok
   604 	*/
   604 	*/
   605 
   605 
   606 	ctr = _vehicle_id_ctr_day;
   606 	ctr = _vehicle_id_ctr_day;
   607 	for (i = 0; i != (_vehicles_size / vehicles_per_day) + 1 && ctr != _vehicles_size; i++) {
   607 	for (i = 0; i != ((uint)GetVehiclePoolSize() / vehicles_per_day) + 1 && ctr != GetVehiclePoolSize(); i++) {
   608 		Vehicle *v = GetVehicle(ctr++);
   608 		Vehicle *v = GetVehicle(ctr++);
   609 		if ((t = v->type) != 0)
   609 		if ((t = v->type) != 0)
   610 			_on_new_vehicle_day_proc[t - 0x10](v);
   610 			_on_new_vehicle_day_proc[t - 0x10](v);
   611 	}
   611 	}
   612 	_vehicle_id_ctr_day = ctr;
   612 	_vehicle_id_ctr_day = ctr;