From 9a1c0f139aeafd3ff550d0689e3a4c227927f0e5 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 23 Jan 2011 14:58:54 +0000 Subject: (svn r21902) -Fix: Do not count articulated parts when passing the number of vehicles to refit to the command. That may exceed 8 bits. --- src/vehicle_gui.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/vehicle_gui.cpp') diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 5bd5f18ef..9c94fea4b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -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; } } -- cgit v1.2.3-70-g09d2