From 3323ac3bf34cfe64b395ad5d8498d1c78a4b4617 Mon Sep 17 00:00:00 2001 From: san-e <67925673+san-e@users.noreply.github.com> Date: Sun, 23 Apr 2023 16:42:24 +0200 Subject: [PATCH] fix System.lanes() --- flint/entities/universe.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flint/entities/universe.py b/flint/entities/universe.py index 4e1e44b..50a503e 100644 --- a/flint/entities/universe.py +++ b/flint/entities/universe.py @@ -64,9 +64,12 @@ def lanes(self) -> 'List[List[TradeLaneRing]]': for first_ring in lanes: current_ring = first_ring while current_ring: - current_ring = rings.get(current_ring.next_ring) - if current_ring: - lanes[first_ring].append(current_ring) + if current_ring.next_ring: + current_ring = rings.get(current_ring.next_ring) + if current_ring: + lanes[first_ring].append(current_ring) + else: + break return [[f, *r] for f, r in lanes.items()] # flatten grouping dict into list of lists def region(self) -> str: