[Change] Only actually load commodities that can be traded.

This commit is contained in:
Allanis 2014-08-04 23:42:05 +01:00
parent c36b3ed986
commit 741789391d

View File

@ -10,7 +10,13 @@ class Commodities:
def loadCommodities(self, xmlfile=None):
if xmlfile == None:
xmlFile = self.commoditiesXML
self.commodities = data.load(xmlfile, "commodity", True)
tmp = data.load(xmlfile, "commodity", True)
for t in tmp:
try:
if tmp[t]['price'] != None:
self.commodities[t] = tmp[t]
except:
continue
def data(self):
return self.commodities