From f6e4298d8421d69bd6c2c8f01225effca1ea99d3 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 21 Jul 2015 20:11:34 -0700 Subject: [PATCH] Fixed issue with EDAPI plugin --- CHANGES.txt | 3 +++ plugins/edapi_plug.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 29eedbfb..0088e6ce 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,9 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014 ============================================================================== +v7.3.1 Jul 21 2015: +. (kfsone) Fix for edapi. + Jul 07 2015: . (kfsone) Fixed division by zero in transfers.py with empty file diff --git a/plugins/edapi_plug.py b/plugins/edapi_plug.py index 31da8354..d82091e6 100644 --- a/plugins/edapi_plug.py +++ b/plugins/edapi_plug.py @@ -604,7 +604,7 @@ def run(self): f.write("\t+ {}\n".format(commodity['categoryname'])) # If stock is zero, list it as unavailable. - if commodity['stock'] == 0: + if commodity['stock'] or 0 == 0: commodity['stock'] = '-' else: demand = bracket_levels[int(commodity['stockBracket'])] @@ -612,7 +612,7 @@ def run(self): # If demand is zero, zero out the sell price. if (commodity['demand'] == 0 or - commodity['demandBracket'] == 0 + commodity['demandBracket'] or 0 == 0 ): commodity['demand'] = '?' commodity['sellPrice'] = 0