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; }