Wrong offer assignment, resulting in returned data of newest offers not cheapest
This commit is contained in:
parent
05964f6c58
commit
5c47b70ea6
@ -5,7 +5,7 @@
|
|||||||
__author__ = """Eriks Karls"""
|
__author__ = """Eriks Karls"""
|
||||||
__email__ = 'eriks@72.lv'
|
__email__ = 'eriks@72.lv'
|
||||||
__version__ = '0.20.0'
|
__version__ = '0.20.0'
|
||||||
__commit_id__ = "d95c472"
|
__commit_id__ = "05964f6"
|
||||||
|
|
||||||
from erepublik import classes, utils
|
from erepublik import classes, utils
|
||||||
from erepublik.citizen import Citizen
|
from erepublik.citizen import Citizen
|
||||||
|
@ -1054,8 +1054,10 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
if (obj.price > float(offer["priceWithTaxes"]) or (
|
if (obj.price > float(offer["priceWithTaxes"]) or (
|
||||||
obj.price == float(offer["priceWithTaxes"]) and obj.amount < int(offer["amount"])
|
obj.price == float(offer["priceWithTaxes"]) and obj.amount < int(offer["amount"])
|
||||||
)):
|
)):
|
||||||
offers[f"q{q}"] = OfferItem(float(offer["priceWithTaxes"]), int(offer["country_id"]),
|
offers[f"q{q}"] = obj = OfferItem(
|
||||||
int(offer["amount"]), int(offer["id"]), int(offer["citizen_id"]))
|
float(offer["priceWithTaxes"]), int(offer["country_id"]), int(offer["amount"]),
|
||||||
|
int(offer["id"]), int(offer["citizen_id"])
|
||||||
|
)
|
||||||
self.write_log(f"Scraped market in {self.now - start_dt}!")
|
self.write_log(f"Scraped market in {self.now - start_dt}!")
|
||||||
|
|
||||||
return offers
|
return offers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user