Skip to content

Commit

Permalink
Fix for origin system being doubled up in getDestinations sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Jan 15, 2015
1 parent a7d33d5 commit fb6aa95
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ def getDestinations(self,
pathList = { system.ID: DestinationNode(system, None, -1.0)
for system in avoidPlaces
if isinstance(system, System) }
if not origSys.ID in pathList:
pathList[origSys.ID] = openList[0]

# As long as the open list is not empty, keep iterating.
jumps = 0
Expand Down Expand Up @@ -1220,17 +1222,6 @@ def getDestinations(self,
openList.append(destNode)

destStations = []
# always include the local stations, unless the user has indicated they are
# avoiding this system. E.g. if you're in Chango but you've specified you
# want to avoid Chango...
if origSys not in avoidPlaces:
for station in origSys.stations:
if (trading and station not in tradingWith):
continue
if (maxPadSize and not station.checkPadSize(maxPadSize)):
continue
if station not in avoidPlaces:
destStations.append(Destination(origSys, station, [], 0.0))

# We have a system-to-system path list, now we
# need stations to terminate at.
Expand Down

0 comments on commit fb6aa95

Please sign in to comment.