(svn r21902) -Fix: Do not count articulated parts when passing the number of vehicles to refit to the command. That may exceed 8 bits.

This commit is contained in:
frosch
2011-01-23 14:58:54 +00:00
parent 3f103c35a6
commit 9a1c0f139a
3 changed files with 21 additions and 22 deletions

View File

@@ -758,9 +758,14 @@ struct RefitWindow : public Window {
if (left_x < 0 && !start_counting) {
this->selected_vehicle = u->index;
start_counting = true;
/* Count the first vehicle, even if articulated part */
this->num_vehicles++;
} else if (start_counting && !u->IsArticulatedPart()) {
/* Do not count articulated parts */
this->num_vehicles++;
}
if (start_counting) this->num_vehicles++;
if (right_x < 0) break;
}
}