Skip to content

Commit

Permalink
Allow getDestinations(trade=False) from a system rather than station
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Jan 15, 2015
1 parent 4317753 commit a7d33d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,8 @@ def getDestinations(self,
Limits to stations we are trading with if trading is True.
"""

assert isinstance(origin, Station)

if trading:
assert isinstance(origin, Station)
if not origin.tradingWith:
return []
tradingWith = origin.tradingWith
Expand All @@ -1173,7 +1172,7 @@ def getDestinations(self,
# The closed list is the list of nodes we've already been to (so
# that we don't create loops A->B->C->A->B->C->...)

origSys = origin.system
origSys = origin.system if isinstance(origin, Station) else origin
openList = [ DestinationNode(origSys, [origSys], 0) ]
# I don't want to have to consult both the pathList
# AND the avoid list every time I'm considering a
Expand Down

0 comments on commit a7d33d5

Please sign in to comment.