summaryrefslogtreecommitdiff
path: root/src/linkgraph
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-06-13 04:29:24 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-07-09 21:36:09 +0200
commita543a4b7bb0d869800591ec1504b3934b68ecd8f (patch)
treeb3c63e456cf0e544c2ec6301d85f34c7dea9d6d2 /src/linkgraph
parent89ab8b79a51b4963da55dce195ea1ab520c73b50 (diff)
downloadopenttd-a543a4b7bb0d869800591ec1504b3934b68ecd8f.tar.xz
Codechange: Remove FOR_EACH_SET_CARGO_ID
Diffstat (limited to 'src/linkgraph')
-rw-r--r--src/linkgraph/linkgraph_gui.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp
index e0986fdb5..056d958ce 100644
--- a/src/linkgraph/linkgraph_gui.cpp
+++ b/src/linkgraph/linkgraph_gui.cpp
@@ -65,8 +65,7 @@ void LinkGraphOverlay::RebuildCache()
StationLinkMap &seen_links = this->cached_links[from];
uint supply = 0;
- CargoID c;
- FOR_EACH_SET_CARGO_ID(c, this->cargo_mask) {
+ for (CargoID c : SetCargoBitIterator(this->cargo_mask)) {
if (!CargoSpec::Get(c)->IsValid()) continue;
if (!LinkGraph::IsValidID(sta->goods[c].link_graph)) continue;
const LinkGraph &lg = *LinkGraph::Get(sta->goods[c].link_graph);
@@ -192,8 +191,7 @@ inline bool LinkGraphOverlay::IsLinkVisible(Point pta, Point ptb, const DrawPixe
*/
void LinkGraphOverlay::AddLinks(const Station *from, const Station *to)
{
- CargoID c;
- FOR_EACH_SET_CARGO_ID(c, this->cargo_mask) {
+ for (CargoID c : SetCargoBitIterator(this->cargo_mask)) {
if (!CargoSpec::Get(c)->IsValid()) continue;
const GoodsEntry &ge = from->goods[c];
if (!LinkGraph::IsValidID(ge.link_graph) ||