summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-06-03 15:07:27 +0000
committerfrosch <frosch@openttd.org>2012-06-03 15:07:27 +0000
commit8ec00c4cc9417bbc2971a6e2c5985f13af2f05f2 (patch)
tree46d1be24d213a151fa01b452cd0a9315e167ac0d /src/build_vehicle_gui.cpp
parent0e9422c43a668fe08b30f96ccd1317bae5af8356 (diff)
downloadopenttd-8ec00c4cc9417bbc2971a6e2c5985f13af2f05f2.tar.xz
(svn r24321) -Change/Fix [FS#4254]: [NewGRF] Group vehicles in the purchase list properly by source GRF, but also consider engine GRFID overrides.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 3d915a683..4921dfe44 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -99,7 +99,7 @@ static CargoID _last_filter_criteria[] = {CF_ANY, CF_ANY, CF_ANY, CF_ANY};
*/
static int CDECL EngineNumberSorter(const EngineID *a, const EngineID *b)
{
- int r = ListPositionOfEngine(*a) - ListPositionOfEngine(*b);
+ int r = Engine::Get(*a)->list_position - Engine::Get(*b)->list_position;
return _internal_sort_order ? -r : r;
}
@@ -1100,7 +1100,7 @@ struct BuildVehicleWindow : Window {
this->sel_engine = sel_id;
- /* make engines first, and then wagons, sorted by ListPositionOfEngine() */
+ /* make engines first, and then wagons, sorted by selected sort_criteria */
_internal_sort_order = false;
EngList_Sort(&this->eng_list, TrainEnginesThenWagonsSorter);