Codechange: [Linkgraph] Only store present link graph edges and not all possible edges.

This commit is contained in:
Michael Lutz
2023-01-02 21:46:49 +01:00
parent 178249e7cc
commit 7352f812e6
9 changed files with 153 additions and 146 deletions

View File

@@ -106,7 +106,7 @@ Station::~Station()
for (NodeID node = 0; node < lg->Size(); ++node) {
Station *st = Station::Get((*lg)[node].Station());
st->goods[c].flows.erase(this->index);
if ((*lg)[node][this->goods[c].node].LastUpdate() != INVALID_DATE) {
if ((*lg)[node].HasEdgeTo(this->goods[c].node) && (*lg)[node][this->goods[c].node].LastUpdate() != INVALID_DATE) {
st->goods[c].flows.DeleteFlows(this->index);
RerouteCargo(st, c, this->index, st->index);
}