From ff35288ddfa3b746412569aed7dfc2eedb1b2094 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 23 Mar 2024 20:18:31 +0000 Subject: [PATCH] Fix: Don't let CT_INVALID map to valid cargo type. (#12364) --- src/cargotype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargotype.cpp b/src/cargotype.cpp index bca7e368b5..98d53a9d1c 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -95,7 +95,7 @@ void BuildCargoLabelMap() CargoSpec::label_map.clear(); for (const CargoSpec &cs : CargoSpec::array) { /* During initialization, CargoSpec can be marked valid before the label has been set. */ - if (!cs.IsValid() || cs.label == CargoLabel{0}) continue; + if (!cs.IsValid() || cs.label == CargoLabel{0} || cs.label == CT_INVALID) continue; /* Label already exists, don't addd again. */ if (CargoSpec::label_map.count(cs.label) != 0) continue;