Merge branch 'master' into jgrpp
# Conflicts: # src/group_cmd.cpp # src/lang/korean.txt # src/lang/simplified_chinese.txt # src/script/api/script_rail.cpp # src/tunnelbridge_cmd.cpp
This commit is contained in:
@@ -1603,8 +1603,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase {
|
||||
{
|
||||
std::vector<EngineID> variants;
|
||||
EngineID sel_id = INVALID_ENGINE;
|
||||
int num_engines = 0;
|
||||
int num_wagons = 0;
|
||||
size_t num_engines = 0;
|
||||
|
||||
list.clear();
|
||||
|
||||
@@ -1625,12 +1624,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase {
|
||||
|
||||
list.emplace_back(eid, e->info.variant_id, e->display_flags, 0);
|
||||
|
||||
if (rvi->railveh_type != RAILVEH_WAGON) {
|
||||
num_engines++;
|
||||
} else {
|
||||
num_wagons++;
|
||||
}
|
||||
|
||||
if (rvi->railveh_type != RAILVEH_WAGON) num_engines++;
|
||||
if (e->info.variant_id != eid && e->info.variant_id != INVALID_ENGINE) variants.push_back(e->info.variant_id);
|
||||
if (eid == this->sel_engine) sel_id = eid;
|
||||
}
|
||||
@@ -1640,6 +1634,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase {
|
||||
if (std::find(list.begin(), list.end(), variant) == list.end()) {
|
||||
const Engine *e = Engine::Get(variant);
|
||||
list.emplace_back(variant, e->info.variant_id, e->display_flags | EngineDisplayFlags::Shaded, 0);
|
||||
if (e->u.rail.railveh_type != RAILVEH_WAGON) num_engines++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1657,7 +1652,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase {
|
||||
EngList_SortPartial(&list, _engine_sort_functions[0][this->sort_criteria], 0, num_engines);
|
||||
|
||||
/* and finally sort wagons */
|
||||
EngList_SortPartial(&list, _engine_sort_functions[0][this->sort_criteria], num_engines, num_wagons);
|
||||
EngList_SortPartial(&list, _engine_sort_functions[0][this->sort_criteria], num_engines, list.size() - num_engines);
|
||||
}
|
||||
|
||||
/* Figure out what road vehicle EngineIDs to put in the list */
|
||||
|
Reference in New Issue
Block a user