From fff2ccd440daa285b4b2922da4c4434bcc0b8c3a Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 3 Nov 2014 15:09:37 -0800 Subject: [PATCH] Added includeSelf flag to genSystemsInRange --- tradedb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tradedb.py b/tradedb.py index be2f1fb3..195d55e3 100644 --- a/tradedb.py +++ b/tradedb.py @@ -533,7 +533,7 @@ def lookupSystemRelaxed(self, key): return system - def genSystemsInRange(self, system, ly): + def genSystemsInRange(self, system, ly, includeSelf=False): """ Generator for systems within ly range of system using a lazily-populated, per-system cache. @@ -542,6 +542,9 @@ def genSystemsInRange(self, system, ly): # Yield what we already have system = self.lookupSystem(system) + if includeSelf: + yield system, 0. + cache = system._rangeCache if not cache: cache = system._rangeCache = System.RangeCache()