Fix: Don't let CT_INVALID map to valid cargo type. (#12364)
(cherry picked from commit ff35288ddf
)
# Conflicts:
# src/cargotype.cpp
This commit is contained in:

committed by
Jonathan G Rennison

parent
5b127ed23e
commit
2219b8e378
@@ -102,7 +102,7 @@ void BuildCargoLabelMap()
|
|||||||
_cargo_label_map.clear();
|
_cargo_label_map.clear();
|
||||||
for (const CargoSpec &cs : CargoSpec::array) {
|
for (const CargoSpec &cs : CargoSpec::array) {
|
||||||
/* During initialization, CargoSpec can be marked valid before the label has been set. */
|
/* 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 add again. */
|
/* Label already exists, don't add again. */
|
||||||
if (_cargo_label_map.count(cs.label) != 0) continue;
|
if (_cargo_label_map.count(cs.label) != 0) continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user