From 87457fccb43e6c0742fd0c0c6612ae4df0e1e04a Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Mon, 5 Nov 2018 23:49:00 +0000 Subject: [PATCH] Settlers of EMF Fix a problem with the road selection cursor getting stuck due to there being duplicate entries in the candidate list --- settlers_of_emf/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settlers_of_emf/main.py b/settlers_of_emf/main.py index 49b1fde..2d549ee 100644 --- a/settlers_of_emf/main.py +++ b/settlers_of_emf/main.py @@ -688,7 +688,8 @@ class Player: for s in [x for x in self.settlements if x.data in r.data]: # Empty road segments connecting those settlement spaces for road in [x for x in self.roads if x.is_empty() and s.data in x.data]: - candidates.append(road) + if road not in candidates: + candidates.append(road) return candidates def build_town_candidates(self): @@ -1032,7 +1033,7 @@ class GameBoard(State): if btn == Buttons.BTN_A: for candidate in self.build_candidates: if candidate.selected: - # Build a town on the selected settlement + # Build a road on the selected road segment if self.interactive_mode == GameBoard.ROAD_MODE: candidate.build_road(self.player.team) # Build a town on the selected settlement