java-topology/defects/openttd-0001/patch/openttd-0001.patch

30 lines
987 B
Diff

# UNDF: UNDF-2026-000000967
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -83,7 +83,7 @@
return (int32_t)((int64_t)a * (int64_t)b >> shift);
}
-typedef std::vector<Industry *> SmallIndustryList;
+typedef std::unordered_set<Industry *> SmallIndustryList;
/**
* Score info, values used for computing the detailed performance rating.
@@ -1015,7 +1015,7 @@
}
/** The industries we've currently brought cargo to. */
-static SmallIndustryList _cargo_delivery_destinations;
+static std::unordered_set<Industry *> _cargo_delivery_destinations;
/**
* Transfer goods from station to industry.
@@ -1054,7 +1054,7 @@
if (ind->exclusive_supplier != INVALID_OWNER && ind->exclusive_supplier != st->owner) continue;
/* Insert the industry into _cargo_delivery_destinations, if not yet contained */
- include(_cargo_delivery_destinations, ind);
+ _cargo_delivery_destinations.insert(ind);
uint amount = std::min(num_pieces, 0xFFFFu - it->waiting);
it->waiting += amount;