1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 01:19:11 +00:00

Fix #11493: Incorrect flow values in LinkGraphJob::EdgeAnnotation (#11494)

This commit is contained in:
Jonathan G Rennison
2023-11-25 20:57:20 +00:00
committed by GitHub
parent c6b9227dbb
commit c5a292c0df

View File

@@ -221,7 +221,7 @@ void Path::Fork(Path *base, uint cap, int free_cap, uint dist)
uint Path::AddFlow(uint new_flow, LinkGraphJob &job, uint max_saturation)
{
if (this->parent != nullptr) {
LinkGraphJob::EdgeAnnotation edge = job[this->parent->node][this->node];
LinkGraphJob::EdgeAnnotation &edge = job[this->parent->node][this->node];
if (max_saturation != UINT_MAX) {
uint usable_cap = edge.base.capacity * max_saturation / 100;
if (usable_cap > edge.Flow()) {