Fix #9708: [Linkgraph] Don't assume vehicles have a non-zero max speed

This commit is contained in:
Nicolas Chappe 2021-12-20 18:00:12 +01:00 committed by Michael Lutz
parent f8a7b76675
commit 8bf56f39f2
1 changed files with 2 additions and 0 deletions

View File

@ -210,6 +210,8 @@ void LinkRefresher::RefreshStats(const Order *cur, const Order *next)
uint cargo_quantity = this->capacities[c];
if (cargo_quantity == 0) continue;
if (this->vehicle->GetDisplayMaxSpeed() == 0) continue;
/* If not allowed to merge link graphs, make sure the stations are
* already in the same link graph. */
if (!this->allow_merge && st->goods[c].link_graph != st_to->goods[c].link_graph) {