src/newgrf_engine.cpp
changeset 8193 a6680b9d7eb1
parent 8144 65cec0877b78
child 8198 a1d062c165b5
equal deleted inserted replaced
8192:807098a4e2c1 8193:a6680b9d7eb1
   801 
   801 
   802 	bool in_motion = v->First()->current_order.type != OT_LOADING;
   802 	bool in_motion = v->First()->current_order.type != OT_LOADING;
   803 
   803 
   804 	totalsets = in_motion ? group->g.real.num_loaded : group->g.real.num_loading;
   804 	totalsets = in_motion ? group->g.real.num_loaded : group->g.real.num_loading;
   805 
   805 
   806 	if (v->cargo.Count() == v->cargo_cap || totalsets == 1) {
   806 	if (v->cargo.Count() >= v->cargo_cap || totalsets == 1) {
   807 		set = totalsets - 1;
   807 		set = totalsets - 1;
   808 	} else if (v->cargo.Empty() || totalsets == 2) {
   808 	} else if (v->cargo.Empty() || totalsets == 2) {
   809 		set = 0;
   809 		set = 0;
   810 	} else {
   810 	} else {
   811 		set = v->cargo.Count() * (totalsets - 2) / max((uint16)1, v->cargo_cap) + 1;
   811 		set = v->cargo.Count() * (totalsets - 2) / max((uint16)1, v->cargo_cap) + 1;