Fix: Don't let CT_INVALID map to valid cargo type. (#12364)

master
Peter Nelson 2 months ago committed by GitHub
parent 02c00f3e3e
commit ff35288ddf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save