1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 16:32:41 +01:00

Codechange: Simplify initialisation of default CargoLabels. (#13214)

This commit is contained in:
Peter Nelson
2025-01-01 00:23:28 +00:00
committed by GitHub
parent 921980d5e2
commit ab1f2683bc
2 changed files with 34 additions and 34 deletions

View File

@@ -136,7 +136,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} || cs.label == CT_INVALID) continue;
if (!cs.IsValid() || cs.label == CargoLabel{} || cs.label == CT_INVALID) continue;
/* Label already exists, don't addd again. */
if (CargoSpec::label_map.count(cs.label) != 0) continue;