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"""
|
||||
__email__ = 'eriks@72.lv'
|
||||
__version__ = '0.20.0'
|
||||
__commit_id__ = "d95c472"
|
||||
__commit_id__ = "05964f6"
|
||||
|
||||
from erepublik import classes, utils
|
||||
from erepublik.citizen import Citizen
|
||||
|
@ -1054,8 +1054,10 @@ class CitizenEconomy(CitizenTravel):
|
||||
if (obj.price > float(offer["priceWithTaxes"]) or (
|
||||
obj.price == float(offer["priceWithTaxes"]) and obj.amount < int(offer["amount"])
|
||||
)):
|
||||
offers[f"q{q}"] = OfferItem(float(offer["priceWithTaxes"]), int(offer["country_id"]),
|
||||
int(offer["amount"]), int(offer["id"]), int(offer["citizen_id"]))
|
||||
offers[f"q{q}"] = obj = OfferItem(
|
||||
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}!")
|
||||
|
||||
return offers
|
||||
|
Loading…
x
Reference in New Issue
Block a user