From 8dfab2a6076f118e1655e91eb9503a7402c65bed Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 Jan 2025 20:34:55 +0000 Subject: [PATCH] Fix #13225: Cargo payment graph key toggled wrong data sets. (#13226) Cargo payment graph should now be filtered only by CargoID instead of sorted position. --- src/graph_gui.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index a39f38432b..ee96100023 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1061,13 +1061,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { void UpdateExcludedData() { - this->excluded_data = 0; - - int i = 0; - for (const CargoSpec *cs : _sorted_standard_cargo_specs) { - if (HasBit(_legend_excluded_cargo_payment_rates, cs->Index())) SetBit(this->excluded_data, i); - i++; - } + this->excluded_data = _legend_excluded_cargo_payment_rates; } void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override @@ -1141,11 +1135,9 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { case WID_GRAPH_DISABLE_CARGOES: { /* Add all cargoes to the excluded lists. */ - int i = 0; for (const CargoSpec *cs : _sorted_standard_cargo_specs) { SetBit(_legend_excluded_cargo_payment_rates, cs->Index()); - SetBit(this->excluded_data, i); - i++; + SetBit(this->excluded_data, cs->Index()); } this->SetDirty(); break;