src/vehicle_gui.cpp
changeset 9569 7697ab949b12
parent 9563 c75bee824deb
child 9584 f8ca7f663cb8
equal deleted inserted replaced
9568:ba4f22e6e3d9 9569:7697ab949b12
   547 /** Sort vehicles by their cargo */
   547 /** Sort vehicles by their cargo */
   548 static int CDECL VehicleCargoSorter(const Vehicle* const *a, const Vehicle* const *b)
   548 static int CDECL VehicleCargoSorter(const Vehicle* const *a, const Vehicle* const *b)
   549 {
   549 {
   550 	const Vehicle *v;
   550 	const Vehicle *v;
   551 	AcceptedCargo diff;
   551 	AcceptedCargo diff;
   552 	MemSetT(diff, 0);
   552 	memset(diff, 0, sizeof(diff));
   553 
   553 
   554 	/* Append the cargo of the connected weagons */
   554 	/* Append the cargo of the connected weagons */
   555 	for (v = *a; v != NULL; v = v->Next()) diff[v->cargo_type] += v->cargo_cap;
   555 	for (v = *a; v != NULL; v = v->Next()) diff[v->cargo_type] += v->cargo_cap;
   556 	for (v = *b; v != NULL; v = v->Next()) diff[v->cargo_type] -= v->cargo_cap;
   556 	for (v = *b; v != NULL; v = v->Next()) diff[v->cargo_type] -= v->cargo_cap;
   557 
   557