From 3ff1560efe151ed7ba5b692f05dd36ce4f74c960 Mon Sep 17 00:00:00 2001 From: dP Date: Wed, 24 Aug 2022 18:53:36 +0300 Subject: [PATCH] Fix cargo selection in charts --- src/graph_gui.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 9f6cd4f8ae..30fa4bf6c2 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -839,15 +839,8 @@ struct ExcludingCargoBaseGraphWindow : BaseGraphWindow { } bool UpdateExcludedCargo() { - uint64 new_excluded_cargo = 0; - - int i = 0; - for (const CargoSpec *cs : _sorted_standard_cargo_specs) { - if (HasBit(_legend_excluded_cargo, cs->Index())) SetBit(new_excluded_cargo, i); - i++; - } - if (this->excluded_cargo == new_excluded_cargo) return false; - this->excluded_cargo = new_excluded_cargo; + if (this->excluded_cargo == _legend_excluded_cargo) return false; + this->excluded_cargo = _legend_excluded_cargo; return true; }