Bugfix - auto buy raw bought all available items in offer, not the required amount

This commit is contained in:
Eriks K 2020-06-01 11:11:48 +03:00
parent 4e337177f2
commit 845cd8d174
2 changed files with 2 additions and 2 deletions

View File

@ -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__ = "eed244d" __commit_id__ = "4e33717"
from erepublik import classes, utils from erepublik import classes, utils
from erepublik.citizen import Citizen from erepublik.citizen import Citizen

View File

@ -2463,7 +2463,7 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenEconomy, CitizenLeade
if not best_offer.country == self.details.current_country: if not best_offer.country == self.details.current_country:
self.travel_to_country(best_offer.country) self.travel_to_country(best_offer.country)
rj = self.buy_from_market(amount=best_offer.amount, offer=best_offer.offer_id) rj = self.buy_from_market(amount=amount, offer=best_offer.offer_id)
if not rj.get('error'): if not rj.get('error'):
amount_needed -= amount amount_needed -= amount
else: else: